Quantcast
Channel: User Chase Seibert - Stack Overflow
Viewing all articles
Browse latest Browse all 43

Configure Django to find all doctests in all modules?

$
0
0

If I run the following command:

>python manage.py test

Django looks at tests.py in my application, and runs any doctests or unit tests in that file. It also looks at the __ test __ dictionary for extra tests to run. So I can link doctests from other modules like so:

#tests.pyfrom myapp.module1 import _function1, _function2__test__ = {"_function1": _function1,"_function2": _function2}

If I want to include more doctests, is there an easier way than enumerating them all in this dictionary? Ideally, I just want to have Django find all doctests in all modules in the myapp application.

Is there some kind of reflection hack that would get me where I want to be?


Viewing all articles
Browse latest Browse all 43

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>