Struggling with unittest discovery - how to structure my project test suite

Serhiy Storchaka storchaka at gmail.com
Fri Dec 20 18:41:40 CET 2013


20.12.13 16:47, Paul Moore написав(ла):
> What's the best way of structuring my projects so that:
>
> 1. I can run all the tests easily on demand.
> 2. I can run just the functional or unit tests when needed.

python -m unittest discover -s tests/functional
python -m unittest discover tests/functional

> 3. I can run individual tests (or maybe just individual test modules, I don't have so many tests yet that I know how detailed I'll need to get!) without too much messing (and certainly without changing any source files!)

python -m unittest discover -s tests/functional -p test_spam.py
python -m unittest discover tests/functional -p test_spam.py
python -m unittest discover tests/functional test_spam.py





More information about the Python-list mailing list