July 2019
Beginner to intermediate
302 pages
9h 38m
English
We can execute all the tests in our application using nose by running the following command:
$ nosetests -v
Test creation of new category ... ok
Test creation of new product ... ok
Test home page ... ok
Test Products list page ... ok
Test searching product ... ok
---------------------------------------------------------------- ----
Ran 5 tests in 0.399s
OK
This will pick out all the tests in our application and run them even if we have multiple test files.
To run a single test file, simply run the following command:
$ nosetests app_tests.py
Now, if you want to run a single test, simply run this command:
$ nosetests app_tests:CatalogTestCase.test_home
This becomes important when we have a memory-intensive application ...