Practicum 7: Testing, Testing, Testing

Objectives:

  • Spend more time writing unit tests

In Exercise 7.1, you wrote some simple unit tests for the stock.py module. This practicuum is simple—write unit tests for some of your other modules:

  • Write unit tests for the parse_csv() function in fileparse.py

  • Write unit tests for various TableFormatter classes in tableformat.py

  • Write unit tests for functions in report.py

Some of these tests will require a bit of thought because of their reliance on external files. Think about how you want to handle that. For example, perhaps it would make sense for a test to first create a temporary file to use as input for functions being tested.

Links

[ Back | Next | Index ]