Python Testing Tips

Mock HTTP Calls Effortlessly in Python with responses

Jan. 7, 2026

A utility for mocking Python's requests library in tests, helping avoid real network traffic during testing.

Time Travel in Your Tests with freezegun

Nov. 27, 2025

A library enabling developers to freeze time in tests for reliable validation of subscription status, trial eligibility, and date calculations.

How to mock different return values for each call of a method

Oct. 14, 2025

Techniques for handling scenarios where identical methods need distinct behaviors across multiple invocations.

How to customize assertion error message

Sept. 16, 2025

Methods for improving test failure clarity through custom error messaging.

Name parameterized pytest examples

April 3, 2025

Guidance on maintaining readability when using pytest parametrization with numerous examples.

create_autospec – easily ensure that mocked objects are called correctly

March 13, 2025

Using create_autospec to guarantee proper mock object usage in automated tests.

Parametrize tests using pytest

Feb. 5, 2025

Leveraging pytest parametrization to test multiple scenarios efficiently.

Testing behavior, not implementation details – part 3

April 10, 2024

Focuses on execution speed and parallel test strategies for comprehensive testing.

Testing behavior, not implementation details – part 2

March 27, 2024

Explores the concept of observable behavior in software testing.

Running tests in parallel with pytest

March 12, 2024

Strategies for reducing total test execution time through parallelization.