Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Modern Python Testing with pytest
Hot & New
New
Rating: 5.0 out of 5(5 ratings)
17 students

Modern Python Testing with pytest

Master Python Unit Testing with pytest Quickly and Effectively with Real-World Examples
Last updated 6/2026
English

What you'll learn

  • Write clear, maintainable automated tests using pytest
  • Organise test suites with a scalable project structure
  • Use fixtures to manage test setup, teardown, and dependencies
  • Apply mocking techniques to isolate code and test different execution paths
  • Measure and enforce code coverage standards for reliable applications
  • Configure pytest for long-term use in professional development and CI workflows

Course content

7 sections27 lectures1h 18m total length
  • Introduction and Welcome0:58

    Welcome to the course, and how to get the most out of it

  • Set Up Your Development Environment1:52

    Learn how to set up your development environment in order to use pytest

Requirements

  • You should already be comfortable with basic Python programming, including functions, modules, and running Python code from the command line
  • You should be comfortable installing software on your computer, and working on the command line
  • No prior experience with pytest or other testing frameworks is required

Description

Pytest is a modern, popular Python testing framework used to write and run automated tests for Python code. It makes testing simple and scalable, allowing you to create clear tests with minimal boilerplate while supporting advanced features such as fixtures, parameterisation, and mocking.

Pytest helps developers catch bugs early and refactor code with confidence by making automated testing simple and efficient.

Learn how to write, organise, and run automated tests with pytest to build more reliable and maintainable Python applications.

  • Testing fundamentals and writing your first pytest tests

  • Organising and structuring test suites

  • Using fixtures for reusable test setup and teardown

  • Parameterising tests to cover multiple scenarios

  • Working with markers to group and control test execution

  • Mocking and patching dependencies with pytest tools

  • Testing exceptions and edge cases

  • Generating and interpreting coverage reports

  • Enforcing minimum test coverage standards

  • Configuring pytest and coverage settings for real-world projects

  • Best practices for writing maintainable and effective tests

  • Building a complete testing workflow suitable for professional development and CI pipelines

Developing Python applications is far easier and less error-prone when you can quickly verify that your code works as expected using a testing framework like pytest.

Content and Overview

This course is designed for Python developers who want to learn how to write reliable, maintainable code by building a solid foundation in automated testing with pytest. I designed the course for Python developers who want to move beyond manual testing and learn how to build confidence in their code through automated testing.

This course takes you from writing Python code with no tests to confidently building, organising, and maintaining production-ready applications using pytest. Step by step, you’ll learn how to write, structure, and test Python applications using pytest, while applying best practices to build reliable and maintainable code.

  • Suitable for all Python developers, you'll start by learning the core features of pytest.

  • You'll learn how to organise your tests the pytest way, and how to work efficiently with it.

  • At each stage real-world examples are used to show how pytest is used in practical Python development.

  • Throughout the course, we'll use techniques that you can reuse in all your projects.

  • All the source code developed in the lectures is available to download.

  • All the time we'll adhere to industry standards and best practices.

By the end of the course, you’ll be able to confidently write, structure, and run pytest tests to build reliable Python applications.

Complete with all the code shown in the lectures, you'll be able to work alongside the instructor and will receive a verifiable certificate of completion upon finishing the course.

Also, at all times throughout the course you have access to the instructor in the Q&A section to ask for help with any topic related to the course.

Enrol now and start building confidence in your Python code through practical, real-world testing with pytest.

Who this course is for:

  • Python developers who want to learn automated testing with pytest
  • Anyone interested in learning modern Python testing practices used in professional projects