
Explore Python unit testing fundamentals, including terminology and test design, and learn to design good test cases while avoiding bad ones, using the built-in unit test module.
Discover why unit testing matters in Python, a language easy to learn with open source libraries, and learn how writing tests with unittest and pytest saves development time.
Explore the unittest documentation to understand core concepts like test, fixture, test case, suite, and test run, along with assertions and command line options.
Learn to structure Python unit tests with unittest and pytest across multiple test classes and files, using descriptive test names, test discovery, and proper test configuration for calculator scenarios.
Learn how to skip or ignore unit test cases in the unittest framework using the skip annotation, understand its impact on test results, and document the reasons for skipping.
Discover how to create and run a test suite, load test cases from modules or classes, use a test loader and runner, and interpret detailed results.
Explore the module overview of Python unit testing with unittest and pytest, including how pytest identifies tests and skips them. Learn parameterization and fixtures to categorize tests.
Explore sample Python apps to practice unit testing with unittest and pytest, reviewing a calculator class and an employee module with properties, validations, bonuses, retirement contributions, and compensation calculations.
Learn to write python tests with assertions using unittest and pytest, handle division by zero errors with context managers, and validate exception messages and dictionary data.
Discover how pytest and unittest identify tests, with modules and functions named starting or ending with test, and customize behavior using pytest.ini with python_files, python_classes, and python_functions.
Define and use custom pytest markers to categorize tests, such as both_positive and one_negative, register them to avoid warnings, and run selective tests with -m against a calculator class.
Explore this module overview for Python unit testing fundamentals, including running a subset of test cases, applying thresholds, identifying slow tests, and parallel execution with three workers.
Learn to generate readable HTML test reports from unit test results by installing a reporting package, running tests to produce HTML output, and sharing results with the team.
You might be wondering what this course is about? Well, this course is all about Unit Testing with Python and how it can help you become better at the art of programming. In other words, this course will teach you how to use Unit Testing to improve code quality and support future development.
Unit tests should provide immediate value in terms of reduced debugging and better design, which is why it’s a skill that should be mastered by all python programmers, regardless of their career path. This course will show you how to write unit tests for your code in Python! The course is designed to be practical with hands-on examples you can use right away.
Good unit tests should provide immediate value in terms of reduced debugging and better design, and increase your confidence in the code.
A lot of people can learn to write unit tests with this course, regardless of their career path. To help you get started, you get a 30-day money back guarantee on your purchase
You will learn:
Understand the terms: Test Case, Test Suite, Test Runner, Unit Under Test and Test Fixture.
Write Unit Tests
Running Unit Tests
Writing Test Suite
Skipping and Ignoring Unit Tests
Setup and TearDown
Test Discovery
Handling Known Errors
Best Practices