temporal-python-testing

Guide deterministic Temporal workflow tests in Python with pytest and WorkflowEnvironment.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/ekremmkasap/jarvis --skill temporal-python-testing-ekremmkasap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: temporal-python-testing
Source: https://github.com/ekremmkasap/jarvis/tree/main/server/agent_prompts/wshobson/plugins/backend-development/skills/temporal-python-testing
Command: npx skills add https://github.com/ekremmkasap/jarvis --skill temporal-python-testing-ekremmkasap

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes resources (resource) components.

What problem does it solve?

This skill provides comprehensive guidance for building deterministic, reliable tests for Temporal workflows in Python, covering unit, integration, and replay testing practices.

Core Features & Use Cases

  • Comprehensive guidance for unit testing workflows and activities using WorkflowEnvironment and ActivityEnvironment.
  • Integration testing with mocked activities, error injection, and multi-activity workflows.
  • Replay testing concepts, local development setup, and CI/CD integration for Temporal Python projects.

Quick Start

Use the temporal-python-testing skill to bootstrap your Python Temporal tests and run unit, integration, and replay tests locally.

Frequently Asked Questions about temporal-python-testing

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

FAQPage Schema
How do I write deterministic Python tests for Temporal workflows?

To write deterministic Python tests for Temporal workflows, use the Temporal Python SDK testing tools like WorkflowEnvironment and ActivityEnvironment to isolate and control workflow execution time and state.

What is the best way to unit test Temporal activities in Python?

Unit testing Temporal activities in Python is best done using the ActivityEnvironment provided by the Temporal Python SDK, which allows you to invoke activities directly and mock external dependencies for reliable testing.

How do I perform replay testing against production histories in Temporal Python?

Replay testing in Temporal Python involves executing workflow code against recorded production event histories to verify determinism and catch regressions without affecting live systems.

Can I use pytest with Temporal Python SDK testing tools for integration testing?

Yes, you can use pytest with Temporal Python SDK testing tools to perform integration testing, allowing you to mock activities, inject errors, and test multi-activity workflows effectively.

How does time-skipping work in Temporal workflow tests?

Time-skipping in Temporal workflow tests automatically advances the mock clock when workflows sleep or wait for timers, ensuring tests run instantly while maintaining deterministic execution logic.

Why are my Temporal workflow tests failing non-deterministically?

Temporal workflow tests fail non-deterministically when workflow code executes non-deterministic operations like real time access or external calls instead of using the provided testing environments and mock activities.