@@ -79,7 +79,7 @@ class DTConfig:
79
79
Default is False.
80
80
pytest_extra_ignore : list
81
81
A list of names/modules to ignore when run under pytest plugin. This is
82
- equivalent to using `--ignore=...` cmdline switch.
82
+ equivalent to using `` --ignore=...` ` cmdline switch.
83
83
pytest_extra_skip : dict
84
84
Names/modules to skip when run under pytest plugin. This is
85
85
equivalent to decorating the doctest with `@pytest.mark.skip` or adding
@@ -92,6 +92,11 @@ class DTConfig:
92
92
adding `# may vary` to the outputs of all examples.
93
93
Each key is a doctest name to skip, and the corresponding value is
94
94
a string. If not empty, the string value is used as the skip reason.
95
+ pytest_extra_requires : dict
96
+ Paths to conditionally ignore unless requirements are met.
97
+ The format is ``{path/or/glob/pattern: requirement}``, where the values are
98
+ PEP 508 dependency specifiers. If a requirement is not met, the behavior
99
+ is equivalent to using the ``--ignore=...`` command line switch.
95
100
CheckerKlass : object, optional
96
101
The class for the Checker object. Must mimic the ``DTChecker`` API:
97
102
subclass the `doctest.OutputChecker` and make the constructor signature
@@ -125,6 +130,7 @@ def __init__(self, *, # DTChecker configuration
125
130
pytest_extra_ignore = None ,
126
131
pytest_extra_skip = None ,
127
132
pytest_extra_xfail = None ,
133
+ pytest_extra_requires = None ,
128
134
):
129
135
### DTChecker configuration ###
130
136
self .CheckerKlass = CheckerKlass or DTChecker
@@ -217,6 +223,7 @@ def __init__(self, *, # DTChecker configuration
217
223
self .pytest_extra_ignore = pytest_extra_ignore or []
218
224
self .pytest_extra_skip = pytest_extra_skip or {}
219
225
self .pytest_extra_xfail = pytest_extra_xfail or {}
226
+ self .pytest_extra_requires = pytest_extra_requires or {}
220
227
221
228
222
229
def try_convert_namedtuple (got ):
0 commit comments