How do forcibly skip a unit test in Django?
@skipif and @skipunless is all I found, but I just want to skip a test right now for debugging purposes while I get a few things straightened out.
How do forcibly skip a unit test in Django?
@skipif and @skipunless is all I found, but I just want to skip a test right now for debugging purposes while I get a few things straightened out.
Django 1.10 allows use of tags for unit tests. You can then use the
--exclude-tag=tag_name
flag to exclude certain tags:In the above example, to exclude your tests with the "
slow
" tag you would run:Python's unittest module has a few decorators:
There is plain old
@skip
:If you can't use
@skip
for some reason,@skipIf
should work. Just trick it to always skip with the argumentTrue
:unittest docs
Docs on skipping tests
If you are looking to simply not run certain test files, the best way is probably to use
fab
or other tool and run particular tests.