Nose doesn't just support doctest, it actually enhances it. When you're using Nose, you can write test fixtures for your doctest files.
If you pass
--doctest-fixtures=_fixture on the command line, Nose will go looking for a fixture file whenever it finds a doctest file. The name of the fixture file is based on the name of the doctest file and is calculated by appending the doctest fixture suffix (in other words, the value of
doctest-fixtures) to the main part of the doctest file name, and then adding
.py to the end. For example, if Nose found a doctest file called
pid.txt, and had been told that
doctest‑fixtures=_fixture, it would try to find the test fixture in a file called
The test fixture file for a doctest ...