O'Reilly logo

Python Testing Beginner's Guide by Daniel Arbuckle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Running Your Tests: Follow Your Nose

So far, we've talked a lot about how to write tests, but we haven't said much about how to run them. We've had to explicitly tell Python which tests to run, and we've had the either worry about which version of Python we were using (in the case of doctest) or put an if __name__ == '__main__' inside every module (for unittest). Clearly, there's room for improvement, when it comes to running tests.

In this chapter we shall:

  • Learn about a Python tool called Nose, which automatically finds and executes tests
  • Learn how to make Nose find and execute doctest tests
  • Learn how to make Nose find and execute unittest tests
  • Learn how to use Nose's internal test framework

So let's get on with it!

What is Nose?

Nose is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required