Python SDK
The official Python SDK for Mokra mock servers and MockWorld Tests.Installation
Configuration
Environment variables
Mock Servers
Basic usage
Once configured, HTTP calls are automatically intercepted:With requests
MockWorld Tests
Creating a world
Running code
Observing
Asserting
Accessing state
Seeding
Example: pytest integration
Example: Testing LangChain agents
API Reference
mockworld(name, services)
Creates a new MockWorld.
| Parameter | Type | Description |
|---|---|---|
name | str | Name for the world |
services | list | Services to include |