Mocking

Mocking replaces real components or external services with controlled substitutes, letting tests exercise code without relying on live networks, databases, clocks, or other unpredictable dependencies. It helps isolate behavior, reproduce edge cases, reduce test time, and avoid side effects such as sending real requests or modifying production data. Mocks can stand in for individual functions, HTTP endpoints, sockets, or asynchronous operations, depending on what a test needs to control.

Open source mocking tools include libraries for replacing functions and objects, intercepting HTTP or socket traffic, recording and replaying requests, and generating test data. When choosing one, consider the languages and interfaces it supports, compatibility with your test framework, setup requirements, license, documentation, and maintenance activity. Mocking is useful to developers and test engineers building reliable unit, integration, and application tests.

6 repositories · updated August 4, 2026

Freezegun: Time Travel for Your Python Tests

Freezegun: Time Travel for Your Python Tests

Freezegun is a powerful Python library designed to simplify testing by allowing your tests to travel through time. It achieves this by mocking the `datetime` module, enabling developers to freeze time at a specific point or even simulate its progression. This functionality is crucial for ensuring consistent and reliable test results when dealing with time-sensitive logic.

PythonTestingMocking
Added Aug 4, 2026 View details
Mocket: A Comprehensive Socket Mocking Framework for Python

Mocket: A Comprehensive Socket Mocking Framework for Python

Mocket is a powerful Python framework designed for monkey-patching the `socket` and `ssl` modules, enabling robust testing of network-dependent applications. It serves as both a low-level framework for building custom clients and a ready-to-use mock for HTTP/HTTPS calls, supporting various environments including asyncio and MicroPython. This tool simplifies the process of isolating and testing Python clients that communicate over the socket protocol.

PythonTestingMocking
Added Aug 3, 2026 View details
vcrpy: Simplify and Speed Up Python HTTP Testing

vcrpy: Simplify and Speed Up Python HTTP Testing

vcrpy is a Python library that automatically mocks your HTTP interactions, making testing simpler and significantly faster. Inspired by Ruby's VCR, it records HTTP requests and responses to a 'cassette' file during the first test run, then replays them in subsequent runs, eliminating actual network traffic. This approach ensures deterministic tests, allows offline development, and boosts test execution speed.

HTTPMockingPython
Added Aug 3, 2026 View details
Mimesis: A Powerful Python Library for Realistic Fake Data Generation

Mimesis: A Powerful Python Library for Realistic Fake Data Generation

Mimesis is a robust Python library designed for generating fake yet realistic data across various languages and locales. It simplifies the creation of diverse data types, from personal information to financial details. This makes it an invaluable tool for development, testing, and anonymization tasks.

PythonData GenerationFake Data
Added Aug 2, 2026 View details
responses: Mocking Python Requests for Robust Testing

responses: Mocking Python Requests for Robust Testing

responses is a Python library designed to simplify the process of mocking the `requests` library during testing. It allows developers to define predictable HTTP responses, enabling isolated and reliable unit tests for applications that interact with external APIs. This utility is essential for ensuring test stability and speed by avoiding actual network calls.

PythonTestingMocking
Added Feb 17, 2026 View details
Keploy: API, Integration, and E2E Testing Agent for Developers

Keploy: API, Integration, and E2E Testing Agent for Developers

Keploy is an innovative developer-centric tool designed to simplify API and integration testing. It automatically generates tests and data mocks directly from user traffic, leveraging eBPF for code-less and language-agnostic operation. This powerful agent helps developers achieve high test coverage and streamline their testing workflows efficiently.

GoAPI TestingIntegration Testing
Added Dec 29, 2025 View details

Related topics

OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️