|
6 | 6 |
|
7 | 7 | from agent_env.env.env import DeployedEnv, DeployedGatewayEnv, EnvCapabilityUnsupported |
8 | 8 | from agent_env.env.gateway.constants import EXT_CLOCK_URI |
9 | | -from agent_env.task_step.context import TaskStepContext |
| 9 | +from agent_env.task_step.context import StepContextError, TaskStepContext |
10 | 10 | from agent_env.task_step.task_steps import sync_env_clock as mod |
11 | 11 | from agent_env.task_step.task_steps.sync_env_clock import SyncEnvClockTaskStep, resolve_virtual_time |
12 | 12 |
|
@@ -254,7 +254,7 @@ async def test_strict_execute_skips_websites_but_not_mcp_servers_that_do_not_fol |
254 | 254 | assert [(s["service"], s["reason"]) for s in record["skipped"]] == [("shop", "not_advertised"), ("legacy", "no_env_card")] |
255 | 255 |
|
256 | 256 | unsynced = TaskStepContext(deployed_envs=[_carded(await _composed_card({"mcp-email": [], "shop": [_CLOCK_EXT]}))]) |
257 | | - with patch("agent_env.env.env.Env.get", return_value=env), pytest.raises(RuntimeError, match="email does not advertise"): |
| 257 | + with patch("agent_env.env.env.Env.get", return_value=env), pytest.raises(StepContextError, match="email does not advertise"): |
258 | 258 | await _step(tolerate_missing_sync_time=False).execute(unsynced) |
259 | 259 |
|
260 | 260 |
|
@@ -378,7 +378,7 @@ async def test_a_server_that_cannot_take_the_zone_fails_the_step_before_any_sync |
378 | 378 | monkeypatch.setattr("agent_env.env.env.Env.get", lambda *a, **k: SimpleNamespace(environment_name="email")) |
379 | 379 | context = TaskStepContext(deployed_envs=[_carded(await _composed_card({"mcp-email": [_OLD_EXT]}))]) |
380 | 380 |
|
381 | | - with pytest.raises(RuntimeError, match="takes no timezone"): |
| 381 | + with pytest.raises(StepContextError, match="takes no timezone"): |
382 | 382 | await _zoned(tolerate_missing_sync_time=tolerate).execute(context) |
383 | 383 | assert not any(str(r.url).endswith("/sync_time") for r in sent) |
384 | 384 |
|
@@ -415,7 +415,7 @@ async def test_a_zoned_step_tells_a_website_that_takes_the_zone_and_fails_on_one |
415 | 415 |
|
416 | 416 | _mock_http(monkeypatch, state={"env_get_time_url": CLOCK_URL}) |
417 | 417 | older = TaskStepContext(deployed_envs=[_carded(await _composed_card({"shop": [_OLD_EXT]}))]) |
418 | | - with patch("agent_env.env.env.Env.get", return_value=env), pytest.raises(RuntimeError, match="shop advertises .* takes no timezone"): |
| 418 | + with patch("agent_env.env.env.Env.get", return_value=env), pytest.raises(StepContextError, match="shop advertises .* takes no timezone"): |
419 | 419 | await _zoned().execute(older) |
420 | 420 |
|
421 | 421 |
|
|
0 commit comments