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 that the numbers shown in the report might have small differences if our code includes additional lines or comments:
test_set_and_get_led_brightness_level (test_hexacopter.TestHexacopter) ... I've started setting the Blue LED's brightness level...