Testing with PyTest

  • Basic

  • 21 lesson

  • 6 hours

Learn to write automated tests with PyTest, use fixtures and mocks, test backend code, and confidently find bugs.

Course overview

This course helps beginner backend developers master practical testing with PyTest. You will learn to write checks for functions and exceptions, use fixtures, parametrization, and mocks, and test HTTP clients, files, and database interactions. Every topic is reinforced with hands-on tasks in UPSHELL with auto-checking, SSH access, and an AI mentor.

You will learn
  • Write automated tests with PyTest for backend code

  • Check exceptions and parametrize tests

  • Use fixtures to prepare test data

  • Test HTTP clients, files, and database interactions

Table of contents

PyTest Basics and Running Tests

Practice

Simple Assert Checks

Practice

Organizing Test Files

Practice

Testing Exceptions

Practice

Test Parametrization

Practice

Markers and Test Selection

Practice

Debugging Failing Tests

Practice

Introduction to Fixtures

Practice

Fixture Scopes

Practice

Fixtures with Teardown

Practice

Fixtures in conftest.py

Practice

Fixture Parametrization

Practice

Test Object Factories

Practice

Temp Files and Directories

Practice

Mock Basics in Tests

Practice

Monkeypatch in PyTest

Practice

Checking Calls and Arguments

Practice

Testing HTTP Clients

Practice

Testing Database Code

Practice

Coverage and Test Quality

Practice

Final Mini Project

Practice

  • image-loading

  • image-loading

  • image-loading

  • image-loading

Frequently Asked Questions

A subscription to the platform gives you unlimited access to all courses, as well as access to an online trainer with practical exercises.

Additionally, with a Premium subscription or higher, you also get access to all pet projects and the opportunity to take technical interviews with an AI mentor.

You can cancel your subscription at any time, and you will still have access to the platform for the paid period. You can do this through your personal account in the 'Subscription Management' section.

Yes, you can upgrade to a new plan at any time. We will provide a discount based on the unused time of your current plan. You can change your plan in your personal account.

To request a refund for a paid plan, please contact us at support@upshell.io. We will process your refund for the unused portion of your subscription within 5 business days.

Get access to 23+ courses for backenders with Subscription

Get access to *23+ courses* for backenders with *Subscription*
Have an account?