temporal-python-testing

Test Temporal Python workflows with pytest, time-skipping, and activity mocking.

1|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/mokbhai/claude --skill temporal-python-testing-mokbhai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: temporal-python-testing
Source: https://github.com/mokbhai/claude/tree/main/skills/temporal-python-testing
Command: npx skills add https://github.com/mokbhai/claude --skill temporal-python-testing-mokbhai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of reliably testing Temporal Python workflows, enabling fast feedback and deterministic results by leveraging pytest, time-skipping, and mocking strategies.

Core Features & Use Cases

  • Unit Testing with time-skipping: Run fast tests that simulate long-running workflows.
  • Integration & Replay Testing: Validate end-to-end execution and determinism against recorded histories.
  • Local Dev & CI/CD: Set up Temporal server locally and integrate tests into pipelines for safe deployments.
  • Resource-Guided Learning: Load targeted resources such as unit-testing.md, integration-testing.md, replay-testing.md, and local-setup.md to tailor testing strategies.

Quick Start

Create a pytest-based test that starts a time-skipping WorkflowEnvironment and runs a simple workflow with a Worker, then assert expected results. Example steps: install Temporal Python SDK and pytest, configure a minimal workflow and activity, and execute a test client to verify the outcome.

Frequently Asked Questions about temporal-python-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Temporal Python workflows with pytest?

Testing Temporal Python workflows with pytest involves starting a time-skipping WorkflowEnvironment and running a simple workflow with a Worker to assert expected outcomes for deterministic validation and fast feedback.

What is time-skipping in Temporal workflow testing and when do I need it?

Time-skipping in Temporal testing is a mechanism that simulates long-running workflows instantly, allowing fast unit tests. You need it when validating workflow logic that depends on timers or sleep functions without waiting in real time.

Can I mock activities for Temporal Python unit tests?

Yes, you can mock activities for Temporal Python unit tests to isolate workflow logic. This ensures deterministic test results by replacing actual activity executions with controlled mock responses during pytest runs.

How do I set up a local Temporal server for integration testing?

Setting up a local Temporal server for integration testing involves configuring the environment for end-to-end execution validation. You use pytest with the Temporal Python SDK to validate determinism and ensure safe deployments in CI pipelines.

Does Temporal Python SDK support replay testing against recorded histories?

Yes, the Temporal Python SDK supports replay testing to validate workflow determinism against recorded histories. This ensures that code changes do not break existing workflows by replaying past execution events.

What are the limitations of time-skipping for Temporal workflows?

Time-skipping is limited to simulating time progression within the Temporal test environment and does not speed up actual activity computations. It should not be used to test real-time external API dependencies or non-deterministic side effects.