temporal-python-testing skill
✓ VerifiedTest Temporal workflows using pytest with strategies for unit testing, integration testing, time-skipping, and replay testing.
- GitHub stars
- 42,413
- Files
- 5
- Last commit
- Nov 9, 2026
- License
- MIT
- Allowed tools
- —
What does the temporal-python-testing skill do?
temporal-python-testing tests Temporal workflows using pytest with strategies for unit testing, integration testing, time-skipping, and replay testing.
Summary generated from the skill's SKILL.md.
About the temporal-python-testing skill
Testing Temporal workflows using pytest is what this skill enables for developers building distributed systems. It provides specific strategies for unit testing, integration testing, and replay testing to ensure workflow determinism. An agent should load this skill when implementing new workflow tests, debugging failures, or setting up a local development environment with Docker Compose.
The skill delivers specialized guidance through markdown resources like unit-testing.md and integration-testing.md. It helps users implement time-skipping via WorkflowEnvironment to turn month-long workflows into tests that run in seconds. Developers can also use ActivityEnvironment for isolated activity testing and mocking strategies to separate workflow logic from external dependencies. The goal is to help teams reach at least 80% logic coverage for both workflows and activities while maintaining fast feedback loops.
What an agent can do with it
- 1Accelerate long-running workflow testsUse time-skipping to test workflows that normally span months in just a few seconds.
- 2Isolate workflow logic from dependenciesImplement integration tests by mocking activities to prevent external dependencies from affecting results.
- 3Ensure workflow determinismValidate that workflow changes remain deterministic by replaying production histories.
- 4Configure local development environmentsSet up a complete local development stack including Docker Compose and pytest configurations.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the temporal-python-testing skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the temporal-python-testing skill in Plugin
/plugin marketplace add wshobson/agents /plugin install backend-development@claude-code-workflows
Install the temporal-python-testing skill in Claude Code
~/.claude/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.claude/skills/temporal-python-testingInstall the temporal-python-testing skill in Claude Code (project)
.claude/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing .claude/skills/temporal-python-testingInstall the temporal-python-testing skill in Codex
~/.agents/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.agents/skills/temporal-python-testingInstall the temporal-python-testing skill in Gemini CLI
~/.gemini/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.gemini/skills/temporal-python-testingInstall the temporal-python-testing skill in Claude.ai
npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing temporal-python-testing && zip -r temporal-python-testing.zip temporal-python-testing # claude.ai → Customize → Skills → + → Create skill → Upload a skill → temporal-python-testing.zip
Automated checks
Ran Nov 13, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachablewshobson/agents/plugins/backend-development/skills/temporal-python-testing is public and reachablegithub.com/wshobson/agents/tree/HEAD/plugins/backend-develop ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-09github.com/wshobson/agents/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/wshobson/agents/blob/HEAD/plugins/backend-develop ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/wshobson/agents/blob/HEAD/plugins/backend-develop ↗Pass
SKILL.md
View on GitHubTemporal Python Testing Strategies
Comprehensive testing approaches for Temporal workflows using pytest, progressive disclosure resources for specific testing scenarios.
When to Use This Skill
- Unit testing workflows - Fast tests with time-skipping
- Integration testing - Workflows with mocked activities
- Replay testing - Validate determinism against production histories
- Local development - Set up Temporal server and pytest
- CI/CD integration - Automated testing pipelines
- Coverage strategies - Achieve ≥80% test coverage
Testing Philosophy
Recommended Approach (Source: docs.temporal.io/develop/python/testing-suite):
- Write majority as integration tests
- Use pytest with async fixtures
- Time-skipping enables fast feedback (month-long workflows → seconds)
- Mock activities to isolate workflow logic
- Validate determinism with replay testing
Three Test Types:
- Unit: Workflows with time-skipping, activities with ActivityEnvironment
- Integration: Workers with mocked activities
- End-to-end: Full Temporal server with real activities (use sparingly)
Available Resources
This skill provides detailed guidance through progressive disclosure. Load specific resources based on your testing needs:
Unit Testing Resources
File: resources/unit-testing.md
When to load: Testing individual workflows or activities in isolation
Contains:
- WorkflowEnvironment with time-skipping
- ActivityEnvironment for activity testing
- Fast execution of long-running workflows
- Manual time advancement patterns
- pytest fixtures and patterns
Integration Testing Resources
File: resources/integration-testing.md
When to load: Testing workflows with mocked external dependencies
Contains:
- Activity mocking strategies
- Error injection patterns
- Multi-activity workflow testing
- Signal and query testing
- Coverage strategies
Replay Testing Resources
File: resources/replay-testing.md
When to load: Validating determinism or deploying workflow changes
Contains:
- Determinism validation
- Production history replay
- CI/CD integration patterns
- Version compatibility testing
Local Development Resources
File: resources/local-setup.md
When to load: Setting up development environment
Contains:
- Docker Compose configuration
- pytest setup and configuration
- Coverage tool integration
- Development workflow
Quick Start Guide
Basic Workflow Test
import pytest
from temporalio.testing import WorkflowEnvironment
from temporalio.worker import Worker
@pytest.fixture
async def workflow_env():
env = await WorkflowEnvironment.start_time_skipping()
yield env
await env.shutdown()
@pytest.mark.asyncio
async def test_workflow(workflow_env):
async with Worker(
workflow_env.client,
task_queue="test-queue",
workflows=[YourWorkflow],
activities=[your_activity],
):
result = await workflow_env.client.execute_workflow(
YourWorkflow.run,
args,
id="test-wf-id",
task_queue="test-queue",
)
assert result == expected
Basic Activity Test
from temporalio.testing import ActivityEnvironment
async def test_activity():
env = ActivityEnvironment()
result = await env.run(your_activity, "test-input")
assert result == expected_output
Coverage Targets
Recommended Coverage (Source: docs.temporal.io best practices):
- Workflows: ≥80% logic coverage
- Activities: ≥80% logic coverage
- Integration: Critical paths with mocked activities
- Replay: All workflow versions before deployment
Key Testing Principles
- Time-Skipping - Month-long workflows test in seconds
- Mock Activities - Isolate workflow logic from external dependencies
- Replay Testing - Validate determinism before deployment
- High Coverage - ≥80% target for production workflows
- Fast Feedback - Unit tests run in milliseconds
How to Use Resources
Load specific resource when needed:
- "Show me unit testing patterns" → Load
resources/unit-testing.md - "How do I mock activities?" → Load
resources/integration-testing.md - "Setup local Temporal server" → Load
resources/local-setup.md - "Validate determinism" → Load
resources/replay-testing.md
Additional References
- Python SDK Testing: docs.temporal.io/develop/python/testing-suite
- Testing Patterns: github.com/temporalio/temporal/blob/main/docs/development/testing.md
- Python Samples: github.com/temporalio/samples-python
Files in this skill
5temporal-python-testing skill questions
How do I install the temporal-python-testing skill in Claude Code?
Run npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.claude/skills/temporal-python-testing. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the temporal-python-testing skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How does time-skipping benefit testing?
Time-skipping allows for fast feedback by enabling month-long workflows to be tested in just seconds.