In this chapter, we will cover:
In the previous chapter, we looked at several ways to utilize unittest in creating automated tests. Now, we will look at different ways to gather the tests together and run them. Nose is a useful utility built to discover tests and run them. It is flexible, can be run from either command-line or embedded inside scripts, and is extensible through plugin. Due to its embeddable nature, higher level tools, such as project scripts, it can be built with testing as an option.
What does nose offer that unittest does not? Key things include automatic test discovery and a useful plugin API. There are many nose plugins that provide everything from specially formatted test reports to integration with other tools. We will explore this in more detail in this chapter and in the latter parts of this book.
For more information about nose refer to http://somethingaboutorange.com/mrl/projects/nose.
We need to activate our virtual environment and then install nose for these various recipes.
Create a virtual environment, activate it, and verify that the tools are working:
Next, using pip
, install nose, as shown in the following screenshot:
3.128.226.255