python - How to find out the location of a doctest file when running nose? -
i using python nose run bunch of doctests in subdirectories. calling script nose.cmd:
nosetests --with-doctest --doctest-extension=rst
(the doctests live in *.rst files.)
example directory structure:
\nose.cmd \__init__.py \module1\__init__.py \module1\mymod.py \module1\mymod.rst \module2\... \module3\...
how can path of rst file retrieved in python code inside rst file itself? example in mymod.rst usual sys.path
, __file__
give no information path \module1\ need imports.
of course introduce constant each rst file contains directory, that's not prefer.
because not find way decided run tests without nose.
Comments
Post a Comment