Unit Testing in Python
Offered By: LinkedIn Learning
Course Description
Overview
Learn the fundamentals of unit testing in Python projects. Explore techniques for test-driven development of a Python project using the pytest framework and a Docker container.
Syllabus
Introduction
- Python unit testing with pytest
- Why pytest?
- Roadmap
- Exercise files
- Docker and VS Code (Mac)
- Docker and VS Code (PC)
- Running pytest with Docker
- Overview of TDD
- Basic tests and assertions
- Exceptions
- Challenge: Exceptions
- Solution: Exceptions
- Happy path testing
- Sad path testing
- Fixtures to amortize costly operations
- Factory fixtures
- Parametrization
- Challenge: Parametrization
- Solution: Parameterization
- Using Conftest.py for common functions
- Modularizing conftest.py
- Reading tests to surmise understand behavior
- Challenge: Adding test coverage
- Solution: Adding test coverage
- Next steps
Taught by
Jasmine Omeke
Related Courses
Applied Bayesian for AnalyticsIndian Institute of Management Bangalore via edX Applied Bayesian for Analytics
Indian Institute of Management Bangalore via Swayam