temporal-python-testing by wshobson/agents
npx skills add https://github.com/wshobson/agents --skill temporal-python-testing使用 pytest 对 Temporal 工作流进行综合测试的方法,针对特定测试场景提供渐进式资源。
推荐方法 (来源: docs.temporal.io/develop/python/testing-suite):
三种测试类型 :
此技能通过渐进式披露提供详细指导。根据您的测试需求加载特定资源:
文件 : resources/unit-testing.md : 隔离测试单个工作流或活动时 :
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
文件 : resources/integration-testing.md 何时加载 : 测试包含模拟外部依赖项的工作流时 包含内容 :
文件 : resources/replay-testing.md 何时加载 : 验证确定性或部署工作流更改时 包含内容 :
文件 : resources/local-setup.md 何时加载 : 设置开发环境时 包含内容 :
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
from temporalio.testing import ActivityEnvironment
async def test_activity():
env = ActivityEnvironment()
result = await env.run(your_activity, "test-input")
assert result == expected_output
推荐覆盖率 (来源: docs.temporal.io 最佳实践):
需要时加载特定资源 :
resources/unit-testing.mdresources/integration-testing.mdresources/local-setup.mdresources/replay-testing.md每周安装量
3.5K
代码仓库
GitHub 星标
32.2K
首次出现
Jan 20, 2026
安全审计
安装于
claude-code2.7K
opencode2.6K
gemini-cli2.6K
codex2.5K
cursor2.4K
github-copilot2.2K
Comprehensive testing approaches for Temporal workflows using pytest, progressive disclosure resources for specific testing scenarios.
Recommended Approach (Source: docs.temporal.io/develop/python/testing-suite):
Three Test Types :
This skill provides detailed guidance through progressive disclosure. Load specific resources based on your testing needs:
File : resources/unit-testing.md When to load : Testing individual workflows or activities in isolation Contains :
File : resources/integration-testing.md When to load : Testing workflows with mocked external dependencies Contains :
File : resources/replay-testing.md When to load : Validating determinism or deploying workflow changes Contains :
File : resources/local-setup.md When to load : Setting up development environment Contains :
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
from temporalio.testing import ActivityEnvironment
async def test_activity():
env = ActivityEnvironment()
result = await env.run(your_activity, "test-input")
assert result == expected_output
Recommended Coverage (Source: docs.temporal.io best practices):
Load specific resource when needed :
resources/unit-testing.mdresources/integration-testing.mdresources/local-setup.mdresources/replay-testing.mdWeekly Installs
3.5K
Repository
GitHub Stars
32.2K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code2.7K
opencode2.6K
gemini-cli2.6K
codex2.5K
cursor2.4K
github-copilot2.2K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装