Skip to content

Commit 3d310f4

Browse files
author
Andrei Neagu
committed
refactor test
1 parent 53dba5e commit 3d310f4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,14 @@ async def test_task_result_task_result_is_an_error(
151151

152152
url = TypeAdapter(AnyHttpUrl).validate_python("http://backgroud.testserver.io/")
153153
client = Client(app=bg_task_app, async_client=async_client, base_url=url)
154-
with pytest.raises(RuntimeError) as exec_info:
154+
with pytest.raises(RuntimeError, match="I am failing as requested"):
155155
async with periodic_task_result(
156156
client,
157157
task_id,
158158
task_timeout=10,
159159
status_poll_interval=TASK_SLEEP_INTERVAL / 3,
160160
):
161161
pass
162-
assert f"{exec_info.value}" == "I am failing as requested"
163162
await _assert_task_removed(async_client, task_id, router_prefix)
164163

165164

0 commit comments

Comments
 (0)