Skills temporal-python-testing
๐Ÿงช

temporal-python-testing

Safe โš™๏ธ External commands๐ŸŒ Network access๐Ÿ“ Filesystem access

Test Temporal workflows with pytest and mocks

Temporal workflow tests are often slow or flaky. This skill provides fast, deterministic testing patterns using time-skipping, activity mocking, and replay validation for reliable CI/CD pipelines.

Supports: Claude Codex Code(CC)
๐Ÿ“Š 69 Adequate
1

Download the skill ZIP

2

Upload in Claude

Go to Settings โ†’ Capabilities โ†’ Skills โ†’ Upload skill

3

Toggle on and start using

Test it

Using "temporal-python-testing". Create a test plan for Temporal workflows with unit, integration, and replay coverage.

Expected outcome:

  • Use WorkflowEnvironment with time skipping for fast unit workflow tests
  • Mock external dependencies in integration tests and verify error handling paths
  • Export production histories and replay against new code before deployment

Using "temporal-python-testing". How do I test a workflow that has retry logic and multiple activities?

Expected outcome:

  • Create a test with mocked activities to isolate workflow logic
  • Use ActivityEnvironment to test activity-specific error handling
  • Verify retry behavior by counting activity invocations
  • Test both success and failure paths with assertions

Using "temporal-python-testing". What are common mistakes when testing Temporal workflows?

Expected outcome:

  • Calling real external APIs instead of mocking them
  • Using random() or datetime.now() which breaks replay determinism
  • Skipping replay tests before deploying workflow changes
  • Not using time-skipping for long-running workflow tests

Security Audit

Safe
v4 โ€ข 1/17/2026

Educational documentation for Temporal workflow testing. Static scanner false positives: markdown code block backticks flagged as shell execution, legitimate docs URLs as hardcoded URLs, and test code patterns as cryptographic/C2 indicators. Previous Claude audit (skill-report.json) confirmed safe with no risk factors. All 149 findings are false positives from documentation patterns.

6
Files scanned
2,131
Lines analyzed
3
findings
4
Total audits

Risk Factors

โš™๏ธ External commands (125)
resources/integration-testing.md:11-49 resources/integration-testing.md:49-54 resources/integration-testing.md:54-102 resources/integration-testing.md:102-109 resources/integration-testing.md:109-152 resources/integration-testing.md:152-157 resources/integration-testing.md:157-197 resources/integration-testing.md:197-203 resources/integration-testing.md:203-260 resources/integration-testing.md:260-264 resources/integration-testing.md:264-301 resources/integration-testing.md:301-307 resources/integration-testing.md:307-358 resources/integration-testing.md:358-366 resources/integration-testing.md:366-376 resources/integration-testing.md:376-382 resources/integration-testing.md:382-393 resources/integration-testing.md:393-399 resources/integration-testing.md:399-411 resources/integration-testing.md:411-415 resources/integration-testing.md:415-436 resources/local-setup.md:9-54 resources/local-setup.md:54-58 resources/local-setup.md:58-76 resources/local-setup.md:76-80 resources/local-setup.md:80-120 resources/local-setup.md:120-126 resources/local-setup.md:126-153 resources/local-setup.md:153-157 resources/local-setup.md:157-184 resources/local-setup.md:184-188 resources/local-setup.md:188-235 resources/local-setup.md:235-239 resources/local-setup.md:239-246 resources/local-setup.md:246-248 resources/local-setup.md:248-273 resources/local-setup.md:273-279 resources/local-setup.md:279-301 resources/local-setup.md:301-305 resources/local-setup.md:305-323 resources/local-setup.md:323-327 resources/local-setup.md:327-342 resources/local-setup.md:342-348 resources/local-setup.md:348-366 resources/local-setup.md:366-370 resources/local-setup.md:370-383 resources/local-setup.md:383-387 resources/local-setup.md:387-424 resources/local-setup.md:424-428 resources/local-setup.md:428-472 resources/local-setup.md:472-478 resources/local-setup.md:478-485 resources/local-setup.md:485-489 resources/local-setup.md:489-497 resources/local-setup.md:497-501 resources/local-setup.md:501-507 resources/local-setup.md:507-522 resources/local-setup.md:522-529 resources/local-setup.md:529-532 resources/local-setup.md:532-535 resources/local-setup.md:535-538 resources/local-setup.md:538-543 resources/local-setup.md:372 resources/replay-testing.md:25-47 resources/replay-testing.md:47-51 resources/replay-testing.md:51-74 resources/replay-testing.md:74-81 resources/replay-testing.md:81-95 resources/replay-testing.md:95-98 resources/replay-testing.md:98-114 resources/replay-testing.md:114-117 resources/replay-testing.md:117-136 resources/replay-testing.md:136-140 resources/replay-testing.md:140-176 resources/replay-testing.md:176-182 resources/replay-testing.md:182-199 resources/replay-testing.md:199-203 resources/replay-testing.md:203-218 resources/replay-testing.md:218-224 resources/replay-testing.md:224-264 resources/replay-testing.md:264-268 resources/replay-testing.md:268-302 resources/replay-testing.md:302-306 resources/replay-testing.md:306-344 resources/replay-testing.md:344-350 resources/replay-testing.md:350-394 resources/replay-testing.md:394-398 resources/replay-testing.md:398-420 resources/replay-testing.md:420-435 resources/replay-testing.md:435-439 resources/replay-testing.md:439-444 resources/replay-testing.md:444-446 resources/unit-testing.md:11-39 resources/unit-testing.md:39-42 resources/unit-testing.md:42-49 resources/unit-testing.md:49-72 resources/unit-testing.md:72-75 resources/unit-testing.md:75-97 resources/unit-testing.md:97-102 resources/unit-testing.md:102-137 resources/unit-testing.md:137-145 resources/unit-testing.md:145-158 resources/unit-testing.md:158-163 resources/unit-testing.md:163-177 resources/unit-testing.md:177-180 resources/unit-testing.md:180-197 resources/unit-testing.md:197-202 resources/unit-testing.md:202-222 resources/unit-testing.md:222-228 resources/unit-testing.md:228-244 resources/unit-testing.md:244-248 resources/unit-testing.md:248-258 resources/unit-testing.md:258-273 resources/unit-testing.md:273-314 SKILL.md:38 SKILL.md:48 SKILL.md:58 SKILL.md:67 SKILL.md:79-105 SKILL.md:105-109 SKILL.md:109-116 SKILL.md:116-137 SKILL.md:137-138 SKILL.md:138-139 SKILL.md:139-140
๐ŸŒ Network access (6)
๐Ÿ“ Filesystem access (4)
Audited by: claude View Audit History โ†’

Quality Score

38
Architecture
100
Maintainability
87
Content
19
Community
100
Security
91
Spec Compliance

What You Can Build

Add fast unit tests

Create quick workflow and activity tests with time skipping that run in milliseconds instead of hours.

Validate integration flows

Mock external services and verify complex workflow orchestration paths with error injection.

Run replay checks

Confirm workflow determinism before deployment and validate version compatibility.

Try These Prompts

Start unit tests
Show me a minimal pytest setup to test a workflow with time skipping and a simple activity. Include fixtures and assertions.
Mock activities
Provide an integration test example that mocks activities and verifies workflow branching logic based on activity results.
Replay safety check
Explain how to replay workflow histories from production and detect non-deterministic changes that could break running workflows.
CI coverage plan
Outline a complete CI plan with pytest markers, coverage thresholds, and automated replay tests for safe deployments.

Best Practices

  • Use time skipping for all workflow unit tests to run month-long workflows in seconds
  • Mock external dependencies in integration tests to isolate workflow logic
  • Run replay tests before deploying any workflow changes to ensure determinism

Avoid

  • Calling real external APIs inside workflow tests instead of mocking
  • Using random() or datetime.now() in workflow code without Temporal helpers
  • Skipping replay tests after significant workflow refactors or logic changes

Frequently Asked Questions

What Python versions are supported?
Examples target Python 3.10 or newer with the Temporal Python SDK v1.5.0 or later.
Are there limits on test size?
No fixed limits, but large replay test suites should be batched in CI for performance.
Can I integrate this with existing pytest setups?
Yes, the guidance uses standard pytest fixtures and markers that work with existing configurations.
Does this skill access my data or credentials?
No, it provides guidance only and does not read files, environment variables, or secrets.
What if tests fail due to nondeterminism?
Use workflow.get_version() for safe changes and avoid random or datetime without Temporal helpers.
How does this compare to end-to-end tests?
It emphasizes faster unit and integration tests with mocking, using replay tests for safety validation.

Developer Details

File structure

๐Ÿ“ resources/

๐Ÿ“„ integration-testing.md

๐Ÿ“„ local-setup.md

๐Ÿ“„ replay-testing.md

๐Ÿ“„ unit-testing.md

๐Ÿ“„ SKILL.md