Disabling Python nosetests

Nose already has a builtin decorator for this: from nose.tools import nottest @nottest def test_my_sample_test() #code here … Also check out the other goodies that nose provides: https://nose.readthedocs.org/en/latest/testing_tools.html

How to use nose’s assert_raises?

While the accepted answer is correct, I think there is a better use to assert_raises method. If you simply want to assert that an exception occurs, it’s probably simpler and cleaner to use @raises syntax. @raises(HTTPError) def test_exception_is_raised: call_your_method(p1, p2) However, assume you want to do bit more with the raised exception, for example: we … Read more

How do I run a single test with Nose in Pylons

nosetests appname.tests.functional.test_controller should work, where the file is named test_controller.py. To run a specific test class and method use a path of the form module.path:ClassNameInFile.method_name, that is, with a colon separating the module/file path and the objects within the file. module.path is the relative path to the file (e.g. tests/my_tests.py:ClassNameInFile.method_name).