If you are using nose plugin to run your tests , there are some handy tricks that we can use while running tests.
nosetests --with-xunit test_folder --xunit-file=nosetests_test_results.xml
nosetests test_folder\test_myfile.py:MyTestClass
nosetests test_folder\test_myfile.py:MyTestClass.test_some_case
Use the argument "--exclude" for this. You can use basic rules of regex.
nosetests --collect-only test_o3d\test_xmlrpc --exclude=test_.*Pin
Run test and generate a XML report:
nosetests --with-xunit test_folder --xunit-file=nosetests_test_results.xml
Run test but only to collect the details. Do not run the actual test.
- nosetests --collect-only test_folder
- nosetests -v --collect-only test_folder
- nosetests -v --collect-only test_folder --with-xunit
Run all test under a particular class from a test script.
nosetests test_folder\test_myfile.py:MyTestClass
Run a single test in a test script
nosetests test_folder\test_myfile.py:MyTestClass.test_some_case
Exclude some tests based on regular expressions
Use the argument "--exclude" for this. You can use basic rules of regex.
nosetests --collect-only test_o3d\test_xmlrpc --exclude=test_.*Pin
No comments:
Post a Comment