File: skip_some_remote_data.rst

package info (click to toggle)
pytest-doctestplus 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 352 kB
  • sloc: python: 2,004; makefile: 13; sh: 7
file content (99 lines) | stat: -rw-r--r-- 1,786 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
:orphan:

Some test cases for remote data
*******************************

We only run tests on this file when ``remote-data`` is not opted in as most
of the code examples below should fail if not skipped.


Remote data block code sandwiched in block codes
================================================

This code block should work just fine::

    >>> 1 + 1
    2

This should be skipped when remote data is not requested
otherwise the test should fail::

.. doctest-remote-data::

    >>> 1 + 3
    2

This code block should work just fine::

    >>> 1 + 1
    2


Remote data followed by plain block code
========================================

This one should be skipped when remote data is not requested
otherwise the test should fail::

.. doctest-remote-data::

    >>> 1 + 3
    2

This code block should work just fine::

    >>> 1 + 1
    2


Several blocks of Remote data
=============================

The three block codes should be skipped when remote data
is not requested otherwise the tests should fail:

.. doctest-remote-data::

    >>> 1 + 3
    2

.. doctest-remote-data::

    >>> 1 + 4
    2

.. doctest-remote-data::

    >>> 1 + 5
    2

Composite directive with remote data
====================================

This should be skipped otherwise the test should fail::

.. doctest-remote-data::

    >>> 1 + 1
    3
    >>> import warnings
    >>> warnings.warn('A warning occurred', UserWarning)  # doctest: +IGNORE_WARNINGS


Remote data all followed by code cell
=====================================

This codeblock should fail, but is skipped:

.. doctest-remote-data-all::

.. code-block::

    >>> 1 + 1
    3

The this following block should be executed with the simple remote data, but
should be skipped with the all version.

    >>> 1 + 2
    5