We currently have pytest
with the coverage plugin running over our tests in a tests
directory.
What's the simplest way to also run doctests extracted from our main code? --doctest-modules
doesn't work (probably since it just runs doctests from tests
). Note that we want to include doctests in the same process (and not simply run a separate invocation of py.test
) because we want to account for doctest in code coverage.
mypackage/tests
and doctests are e.g. inmypackage/foo
. What does work ispytest mypackage/tests --doctest-modules mypackage/foo
. How would one define that inpytest.ini
? I've tried to express this there, but no cigar. – Accipiter