Originally reported by: Holger Peters (BitBucket: HolgerPeters, GitHub: HolgerPeters)
Pytest has support for doctests using --doctest-module and --doctest-glob flags.
For a sphinx documentation, there are environments to write more complex doctests, including setup and teardown functionality, as sphinx has documented here
http://sphinx-doc.org/ext/doctest.html
It seems that pytest does not handle these, unfortunately for projects that use these contexts and would like to move all their testing to pytest.
_Original comment by_ Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus):
Hi,
I agree this would be a nice addition, but I'm not sure it belongs to the pytest core as it would have to depend on Sphinx to reuse the code from sphinx.ext.doctest. In my opinion this should be implemented as an external plugin instead.
Is there some interest in having setup/teardown?
some = more people besides me and @nicoddemus"
@alanjds are you interested in writing that plugin?
Doing preliminar research to evaluate my options to get it. Will follow the least resistance path ;)
Had this on a Ruby copycat module some time ago, and just found manuel. Maybe a manuel wrapper would fit. Not sure yet...
...
Yes, I would code some PR if needed to.