@@ -79,7 +79,7 @@ class DTConfig:
7979 Default is False.
8080 pytest_extra_ignore : list
8181 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.
8383 pytest_extra_skip : dict
8484 Names/modules to skip when run under pytest plugin. This is
8585 equivalent to decorating the doctest with `@pytest.mark.skip` or adding
@@ -92,6 +92,12 @@ class DTConfig:
9292 adding `# may vary` to the outputs of all examples.
9393 Each key is a doctest name to skip, and the corresponding value is
9494 a string. If not empty, the string value is used as the skip reason.
95+ pytest_extra_requires : dict
96+ Paths or functions to conditionally ignore unless requirements are met.
97+ The format is ``{path/or/glob/pattern: requirement(s), full.func.name: requirement(s)}``,
98+ where the values are PEP 508 dependency specifiers. If a requirement is not met,
99+ the behavior is equivalent to using the ``--ignore=...`` command line switch for
100+ paths, and to using a `pytest_extra_skip` for function names.
95101 CheckerKlass : object, optional
96102 The class for the Checker object. Must mimic the ``DTChecker`` API:
97103 subclass the `doctest.OutputChecker` and make the constructor signature
@@ -125,6 +131,7 @@ def __init__(self, *, # DTChecker configuration
125131 pytest_extra_ignore = None ,
126132 pytest_extra_skip = None ,
127133 pytest_extra_xfail = None ,
134+ pytest_extra_requires = None ,
128135 ):
129136 ### DTChecker configuration ###
130137 self .CheckerKlass = CheckerKlass or DTChecker
@@ -217,6 +224,7 @@ def __init__(self, *, # DTChecker configuration
217224 self .pytest_extra_ignore = pytest_extra_ignore or []
218225 self .pytest_extra_skip = pytest_extra_skip or {}
219226 self .pytest_extra_xfail = pytest_extra_xfail or {}
227+ self .pytest_extra_requires = pytest_extra_requires or {}
220228
221229
222230def try_convert_namedtuple (got ):
0 commit comments