mocket

A socket mock framework with gevent/asyncio/SSL support for Python.

EstablishedOpen SourceLow lock-in

Pricing

Free tier

Flat rate

Adoption

Stable

License

Open Source

Data freshness

Aging · Jun 8, 2026

Overview

What is mocket?

Mocket is a powerful tool that allows developers to mock network sockets in their Python applications, supporting gevent, asyncio, and SSL. It's essential for testing network interactions without actual network traffic.

Key differentiator

Mocket stands out as the only Python library providing robust support for socket mocking with gevent, asyncio, and SSL, making it ideal for comprehensive network testing in Python applications.

Capability profile

Capability Radar

Ease of StartEcosystemValueMaturityFlexibilityScale Ready

Honest assessment

Strengths & Weaknesses

↑ Strengths

Supports gevent and asyncio for asynchronous testing.medium

SSL support for secure socket mocking.medium

Extensive documentation and community support.medium

↓ Weaknesses

Limited support for non-Python environmentshigh

Mocket is primarily designed and optimized for Python, making it less suitable for multi-language projects.

Frequent breaking changes between versionsmedium

The transition from v0.1 to v0.2 required significant rewrites of existing test cases due to API changes.

Complex setup for advanced use-caseshigh

Setting up Mocket for complex asynchronous testing scenarios with gevent and asyncio can be intricate and error-prone.

Fit analysis

Who is it for?

✓ Best for

Python developers who need to mock socket operations for testing purposes.

Teams working on applications that require extensive network interaction testing.

Projects where secure (SSL) socket mocking is necessary for comprehensive testing.

✕ Not a fit for

Developers looking for a cloud-based service for managing their tests.

Projects that do not involve Python or require non-socket-related mocking.

Cost structure

Pricing

Free Tier

Available

Open source — free to use

Starts at

$0

Model

Flat rate

Enterprise

None

Performance benchmarks

How Fast Is It?

Ecosystem

Relationships

Next step

Get Started with mocket

Step-by-step setup guide with code examples and common gotchas.

View Setup Guide →