{"id":"053aeb4a-fdaa-4e94-b368-af6d3aecde62","shortId":"nZEz7m","kind":"skill","title":"temporal-python-testing","tagline":"Comprehensive testing approaches for Temporal workflows using pytest, progressive disclosure resources for specific testing scenarios.","description":"# Temporal Python Testing Strategies\n\nComprehensive testing approaches for Temporal workflows using pytest, progressive disclosure resources for specific testing scenarios.\n\n## Do not use this skill when\n\n- The task is unrelated to temporal python testing strategies\n- You need a different domain or tool outside this scope\n\n## Instructions\n\n- Clarify goals, constraints, and required inputs.\n- Apply relevant best practices and validate outcomes.\n- Provide actionable steps and verification.\n- If detailed examples are required, open `resources/implementation-playbook.md`.\n\n## Use this skill when\n\n- **Unit testing workflows** - Fast tests with time-skipping\n- **Integration testing** - Workflows with mocked activities\n- **Replay testing** - Validate determinism against production histories\n- **Local development** - Set up Temporal server and pytest\n- **CI/CD integration** - Automated testing pipelines\n- **Coverage strategies** - Achieve ≥80% test coverage\n\n## Testing Philosophy\n\n**Recommended Approach** (Source: docs.temporal.io/develop/python/testing-suite):\n\n- Write majority as integration tests\n- Use pytest with async fixtures\n- Time-skipping enables fast feedback (month-long workflows → seconds)\n- Mock activities to isolate workflow logic\n- Validate determinism with replay testing\n\n**Three Test Types**:\n\n1. **Unit**: Workflows with time-skipping, activities with ActivityEnvironment\n2. **Integration**: Workers with mocked activities\n3. **End-to-end**: Full Temporal server with real activities (use sparingly)\n\n## Available Resources\n\nThis skill provides detailed guidance through progressive disclosure. Load specific resources based on your testing needs:\n\n### Unit Testing Resources\n\n**File**: `resources/unit-testing.md`\n**When to load**: Testing individual workflows or activities in isolation\n**Contains**:\n\n- WorkflowEnvironment with time-skipping\n- ActivityEnvironment for activity testing\n- Fast execution of long-running workflows\n- Manual time advancement patterns\n- pytest fixtures and patterns\n\n### Integration Testing Resources\n\n**File**: `resources/integration-testing.md`\n**When to load**: Testing workflows with mocked external dependencies\n**Contains**:\n\n- Activity mocking strategies\n- Error injection patterns\n- Multi-activity workflow testing\n- Signal and query testing\n- Coverage strategies\n\n### Replay Testing Resources\n\n**File**: `resources/replay-testing.md`\n**When to load**: Validating determinism or deploying workflow changes\n**Contains**:\n\n- Determinism validation\n- Production history replay\n- CI/CD integration patterns\n- Version compatibility testing\n\n### Local Development Resources\n\n**File**: `resources/local-setup.md`\n**When to load**: Setting up development environment\n**Contains**:\n\n- Docker Compose configuration\n- pytest setup and configuration\n- Coverage tool integration\n- Development workflow\n\n## Quick Start Guide\n\n### Basic Workflow Test\n\n```python\nimport pytest\nfrom temporalio.testing import WorkflowEnvironment\nfrom temporalio.worker import Worker\n\n@pytest.fixture\nasync def workflow_env():\n    env = await WorkflowEnvironment.start_time_skipping()\n    yield env\n    await env.shutdown()\n\n@pytest.mark.asyncio\nasync def test_workflow(workflow_env):\n    async with Worker(\n        workflow_env.client,\n        task_queue=\"test-queue\",\n        workflows=[YourWorkflow],\n        activities=[your_activity],\n    ):\n        result = await workflow_env.client.execute_workflow(\n            YourWorkflow.run,\n            args,\n            id=\"test-wf-id\",\n            task_queue=\"test-queue\",\n        )\n        assert result == expected\n```\n\n### Basic Activity Test\n\n```python\nfrom temporalio.testing import ActivityEnvironment\n\nasync def test_activity():\n    env = ActivityEnvironment()\n    result = await env.run(your_activity, \"test-input\")\n    assert result == expected_output\n```\n\n## Coverage Targets\n\n**Recommended Coverage** (Source: docs.temporal.io best practices):\n\n- **Workflows**: ≥80% logic coverage\n- **Activities**: ≥80% logic coverage\n- **Integration**: Critical paths with mocked activities\n- **Replay**: All workflow versions before deployment\n\n## Key Testing Principles\n\n1. **Time-Skipping** - Month-long workflows test in seconds\n2. **Mock Activities** - Isolate workflow logic from external dependencies\n3. **Replay Testing** - Validate determinism before deployment\n4. **High Coverage** - ≥80% target for production workflows\n5. **Fast Feedback** - Unit tests run in milliseconds\n\n## How to Use Resources\n\n**Load specific resource when needed**:\n\n- \"Show me unit testing patterns\" → Load `resources/unit-testing.md`\n- \"How do I mock activities?\" → Load `resources/integration-testing.md`\n- \"Setup local Temporal server\" → Load `resources/local-setup.md`\n- \"Validate determinism\" → Load `resources/replay-testing.md`\n\n## Additional References\n\n- Python SDK Testing: docs.temporal.io/develop/python/testing-suite\n- Testing Patterns: github.com/temporalio/temporal/blob/main/docs/development/testing.md\n- Python Samples: github.com/temporalio/samples-python\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["temporal","python","testing","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-temporal-python-testing","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/temporal-python-testing","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34460 github stars · SKILL.md body (5,359 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T06:51:59.928Z","embedding":null,"createdAt":"2026-04-18T21:46:05.131Z","updatedAt":"2026-04-22T06:51:59.928Z","lastSeenAt":"2026-04-22T06:51:59.928Z","tsv":"'/develop/python/testing-suite':559 '/develop/python/testing-suite):':142 '/temporalio/samples-python':569 '/temporalio/temporal/blob/main/docs/development/testing.md':564 '1':178,476 '2':188,487 '3':194,496 '4':503 '5':511 '80':132,454,458,506 'achiev':131 'action':79 'activ':108,165,185,193,204,237,248,280,288,397,399,420,430,437,457,466,489,539 'activityenviron':187,246,426,432 'addit':552 'advanc':259 'appli':71 'approach':7,26,138 'arg':405 'ask':603 'assert':416,441 'async':151,366,380,386,427 'autom':126 'avail':207 'await':371,377,401,434 'base':220 'basic':351,419 'best':73,451 'boundari':611 'chang':310 'ci/cd':124,317 'clarif':605 'clarifi':65 'clear':578 'compat':321 'compos':337 'comprehens':5,24 'configur':338,342 'constraint':67 'contain':240,279,311,335 'coverag':129,134,295,343,445,448,456,460,505 'criteria':614 'critic':462 'def':367,381,428 'depend':278,495 'deploy':308,472,502 'describ':582 'detail':84,212 'determin':112,171,306,312,500,549 'develop':117,324,333,346 'differ':57 'disclosur':14,33,216 'docker':336 'docs.temporal.io':141,450,558 'docs.temporal.io/develop/python/testing-suite':557 'docs.temporal.io/develop/python/testing-suite):':140 'domain':58 'enabl':156 'end':196,198 'end-to-end':195 'env':369,370,376,385,431 'env.run':435 'env.shutdown':378 'environ':334,594 'environment-specif':593 'error':283 'exampl':85 'execut':251 'expect':418,443 'expert':599 'extern':277,494 'fast':97,157,250,512 'feedback':158,513 'file':228,268,300,326 'fixtur':152,262 'full':199 'github.com':563,568 'github.com/temporalio/samples-python':567 'github.com/temporalio/temporal/blob/main/docs/development/testing.md':562 'goal':66 'guid':350 'guidanc':213 'high':504 'histori':115,315 'id':406,410 'import':355,359,363,425 'individu':234 'inject':284 'input':70,440,608 'instruct':64 'integr':103,125,146,189,265,318,345,461 'isol':167,239,490 'key':473 'limit':570 'load':217,232,272,304,330,523,533,540,546,550 'local':116,323,543 'logic':169,455,459,492 'long':161,254,482 'long-run':253 'major':144 'manual':257 'match':579 'millisecond':518 'miss':616 'mock':107,164,192,276,281,465,488,538 'month':160,481 'month-long':159,480 'multi':287 'multi-act':286 'need':55,224,527 'open':88 'outcom':77 'output':444,588 'outsid':61 'path':463 'pattern':260,264,285,319,532,561 'permiss':609 'philosophi':136 'pipelin':128 'practic':74,452 'principl':475 'product':114,314,509 'progress':13,32,215 'provid':78,211 'pytest':12,31,123,149,261,339,356 'pytest.fixture':365 'pytest.mark.asyncio':379 'python':3,21,51,354,422,554,565 'queri':293 'queue':391,394,412,415 'quick':348 'real':203 'recommend':137,447 'refer':553 'relev':72 'replay':109,173,297,316,467,497 'requir':69,87,607 'resourc':15,34,208,219,227,267,299,325,522,525 'resources/implementation-playbook.md':89 'resources/integration-testing.md':269,541 'resources/local-setup.md':327,547 'resources/replay-testing.md':301,551 'resources/unit-testing.md':229,534 'result':400,417,433,442 'review':600 'run':255,516 'safeti':610 'sampl':566 'scenario':19,38 'scope':63,581 'sdk':555 'second':163,486 'server':121,201,545 'set':118,331 'setup':340,542 'show':528 'signal':291 'skill':43,92,210,573 'skill-temporal-python-testing' 'skip':102,155,184,245,374,479 'sourc':139,449 'source-sickn33' 'spare':206 'specif':17,36,218,524,595 'start':349 'step':80 'stop':601 'strategi':23,53,130,282,296 'substitut':591 'success':613 'target':446,507 'task':46,390,411,577 'tempor':2,9,20,28,50,120,200,544 'temporal-python-test':1 'temporalio.testing':358,424 'temporalio.worker':362 'test':4,6,18,22,25,37,52,95,98,104,110,127,133,135,147,174,176,223,226,233,249,266,273,290,294,298,322,353,382,393,408,414,421,429,439,474,484,498,515,531,556,560,597 'test-input':438 'test-queu':392,413 'test-wf-id':407 'three':175 'time':101,154,183,244,258,373,478 'time-skip':100,153,182,243,477 'tool':60,344 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':586 'type':177 'unit':94,179,225,514,530 'unrel':48 'use':11,30,41,90,148,205,521,571 'valid':76,111,170,305,313,499,548,596 'verif':82 'version':320,470 'wf':409 'worker':190,364,388 'workflow':10,29,96,105,162,168,180,235,256,274,289,309,347,352,368,383,384,395,403,453,469,483,491,510 'workflow_env.client':389 'workflow_env.client.execute':402 'workflowenviron':241,360 'workflowenvironment.start':372 'write':143 'yield':375 'yourworkflow':396 'yourworkflow.run':404","prices":[{"id":"f3ba5b3c-3a61-492b-8810-10399ff2d7bb","listingId":"053aeb4a-fdaa-4e94-b368-af6d3aecde62","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:46:05.131Z"}],"sources":[{"listingId":"053aeb4a-fdaa-4e94-b368-af6d3aecde62","source":"github","sourceId":"sickn33/antigravity-awesome-skills/temporal-python-testing","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/temporal-python-testing","isPrimary":false,"firstSeenAt":"2026-04-18T21:46:05.131Z","lastSeenAt":"2026-04-22T06:51:59.928Z"}],"details":{"listingId":"053aeb4a-fdaa-4e94-b368-af6d3aecde62","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"temporal-python-testing","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34460,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-22T06:40:00Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"08b5099c327b23b21d2f01164c6317ea4638c4a2","skill_md_path":"skills/temporal-python-testing/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/temporal-python-testing"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"temporal-python-testing","description":"Comprehensive testing approaches for Temporal workflows using pytest, progressive disclosure resources for specific testing scenarios."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/temporal-python-testing"},"updatedAt":"2026-04-22T06:51:59.928Z"}}