Quoting https://docs.pytest.org/en/stable/doctest.html the last paragraph:
Skipping tests dynamically
New in version 4.4.
You can use pytest.skip to dynamically skip doctests. For example:
>>> import sys, pytest
>>> if sys.platform.startswith('win'):
... pytest.skip('this doctest does not work on Windows')
It is not clear where to put this skip-line into. The module? The specific docstring? Does it apply to every doctest definition in the file?
It could be mentioned that # doctest: +SKIP skips a single line/doctest, which is what most people search for(?). A sentence if xfailis possible would also be great.
@asottile Can I add this in docs explaining with an example ?
@spaceone thanks for the suggestions.
@prakhargurunani sure thing, no need to ask. Thanks!
@nicoddemus Please see #8080
Most helpful comment
@spaceone thanks for the suggestions.
@prakhargurunani sure thing, no need to ask. Thanks!