Run only doctrines from the nose of a python

Is there a way to run only doctrines using Python Nose (nosetests) ?, I do not want to run any unittests, but only doctrines.

Thanks.

+4
source share
2 answers

You can achieve this effect by ignoring all the usual test files. This can be done easily with the -I or --ignore-files options and a regular expression like .*\.py .

Another way could be to save the doctrines in a separate directory and launch the nose.


In newer versions of the nose, this no longer works.

+2
source

This should work with newer versions of nose , but I have not tested it on nested modules.

 echo 'import '"$PACKAGE"', inspect; print("\n".join(x[0] for x in inspect.getmembers('"$PACKAGE"', inspect.ismodule)))' | python | xargs -L 1 --replace echo "$PACKAGE.{}" | nose $(cat) --with-doctest 

If you know an easier way to retrieve a list of modules in doctest (perhaps using a nose?), Then what the first part really does.

0
source

Source: https://habr.com/ru/post/1438884/


All Articles