Skip to content

Commit

Permalink
pytest.raises
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait committed Oct 5, 2022
1 parent 549c902 commit 74f71c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion distributed/tests/test_worker.py
Expand Up @@ -1698,7 +1698,8 @@ async def test_pip_install_fails(c, s, a, b):
with mock.patch(
"distributed.diagnostics.plugin.subprocess.Popen", return_value=mocked
) as Popen:
await c.register_worker_plugin(PipInstall(packages=["not-a-package"]))
with pytest.raises(RuntimeError):
await c.register_worker_plugin(PipInstall(packages=["not-a-package"]))

assert Popen.call_count == 1
logs = logger.getvalue()
Expand Down

0 comments on commit 74f71c5

Please sign in to comment.