Get startedGet started for free

Running your tests

One of your collaborators has just made some changes to your code which has introduced an error. This can happen in the wild, but if you have written tests you will easily be able to find out where this error has come from.

In the exercise, you will use pytest to search for that error in your package and fix it.

This exercise is part of the course

Developing Python Packages

View Course

Exercise instructions

  • Run pytest from the terminal to run all the package tests. You should see a test failure.
  • Try to work out where the failure is coming from. (Remember that the error you corrected in Chapter 2 came from a wrong global variable.)
  • Rerun pytest. All the tests should run successfully.

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise