Course Description

Software unit tests help the developer to verify that the logic of individual pieces of the program is correct. It is vital to the success of refactoring, the act of improving software design without changing the behavior of the system.

In this course, students will learn how to use both Python's built-in unit test module and the Pytest module as a unit testing framework for the Python programming language. This includes the Pytest features of Fixtures and the rich plug-in ecosystem for Pytest. The key unit testing concepts of Behavior-Driven Development (BDD), Test-Driven Development (TDD), Behavior Driven Development (BDD), and Continuous Integration (CI) are also covered. Pytest allows the developer to ensure high test coverage of the code and allows continuing development of new features without having to perform lots of manual tests. Other tools discussed include virtualenv and the Tox testing tool to test in different environments while connecting with a Continuous Integration service like Travis-ci.

Course Outline

  • Introduction to Python Unit Testing and concepts of Test Automation and Test-Driven Development (TDD)
  • Python built-in doctest, and unites features
  • Extending built-in unittest with nose2
  • Pytest Testing Tool
  • Isolate testing environments with Python virtualenv
  • Automate and standardize Python testing with Tox
  • Automating testing with Travis-ci

Learner Outcomes

  • Ability to write unit test using built-in Python unittest module
  • Hands-on experience with downloading, installing, configuring the tools through lab exercises.
  • Solid working knowledge of Python Unit Testing tools and features.


Introduction to Programming, or demonstration of equivalency.


You will have access to your course materials on the published start date OR 1 business day after your enrollment is confirmed if you enroll on or after the published start date.

Software: Anaconda, Visual Studio Code, Jupyter Notebook.
Hardware: Computer with Windows or Mac OS preferred.

Applies Towards the Following Certificates

Not offered this quarter. Classes are offered according to the schedule on the respective Certificate or Program Page. Please click on the Request Information below to be promptly notified when enrollment opens.