Unit Testing in Python

Go to class
Write Review

Free Online Course: Unit Testing in Python provided by LinkedIn Learning is a comprehensive online course, which lasts for 1-2 hours worth of material. The course is taught in English and is free of charge. Upon completion of the course, you can receive an e-certificate from LinkedIn Learning. Unit Testing in Python is taught by Jasmine Omeke.

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
    1. Installation and Setup
    • Docker and VS Code (Mac)
    • Docker and VS Code (PC)
    • Running pytest with Docker
    2. Overview of Test-Driven Development and Pytest Features
    • Overview of TDD
    • Basic tests and assertions
    • Exceptions
    • Challenge: Exceptions
    • Solution: Exceptions
    • Happy path testing
    • Sad path testing
    3. Test Automation with Fixtures and Parametrization
    • Fixtures to amortize costly operations
    • Factory fixtures
    • Parametrization
    • Challenge: Parametrization
    • Solution: Parameterization
    4. Organizing Your Pytest Project
    • Using Conftest.py for common functions
    • Modularizing conftest.py
    5. Using Pytest with an Existing Project
    • Reading tests to surmise behavior
    • Challenge: Adding test coverage
    • Solution: Adding test coverage
    Conclusion
    • Next steps