Running unit tests with nose2 and checking testing coverage
Now, run the following command to create all the necessary tables in our test database and use the nose2 test running to execute all the tests we created. The test runner will execute all the methods for our TestHexacopter
class that start with the test_
prefix and will display the results. In this case, we just have one method that matches the criteria, but we will add more later.
Run the following command within the same virtual environment we have been using. We will use the -v
option to instruct nose2 to print test case names and statuses. The --with-coverage
option turns on test coverage reporting generation:
nose2 -v --with-coverage
The following lines show the sample output. Notice ...
Get Building RESTful Python Web Services now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.