I have a file called test_web.py containing a class TestWeb and many methods named like test_something().
I can run every test in the class like so:
$ nosetests test_web.py ... ====================================================================== FAIL: checkout test ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/me/path/here/test_web.py", line 187, in test_checkout ...
But I can’t seem to run individual tests. These give me “No such test” errors when run in the same PWD:
$ nosetests test_web.py:test_checkout $ nosetests TestWeb:test_checkout
What could be wrong here?
Basic Usage nose can be integrated with DocTest by using with-doctest option in athe bove command line. The result will be true if the test run is successful, or false if it fails or raises an uncaught exception. nose supports fixtures (setup and teardown methods) at the package, module, class, and test level.
django-nose provides all the goodness of nose in your Django tests, like: Testing just your apps by default, not all the standard ones that happen to be in INSTALLED_APPS. Running the tests in one or more specific modules (or apps, or classes, or folders, or just running a specific test)
You must specify it like so: nosetests <file>:<Test_Case>.<test_method>
, or
nosetests test_web.py:TestWeb.test_checkout
See the docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With