Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy warning in test_client.py #7710

Merged
merged 2 commits into from Mar 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions distributed/tests/test_client.py
Expand Up @@ -76,7 +76,7 @@
from distributed.cluster_dump import load_cluster_dump
from distributed.comm import CommClosedError
from distributed.compatibility import LINUX, WINDOWS
from distributed.core import ErrorMessage, Status
from distributed.core import Status
from distributed.diagnostics.plugin import WorkerPlugin
from distributed.metrics import time
from distributed.scheduler import CollectTaskMetaDataPlugin, KilledWorker, Scheduler
Expand Down Expand Up @@ -4822,13 +4822,13 @@ async def fail_instantiate(*_args, **_kwargs):
a.instantiate = fail_instantiate

if raise_for_error: # default is to raise
with pytest.raises(ValueError, match="broken") as excinfo:
with pytest.raises(ValueError, match="broken"):
await c.restart_workers(workers=[a.worker_address])
else:
results = await c.restart_workers(
workers=[a.worker_address], raise_for_error=raise_for_error
)
msg: ErrorMessage = results[a.worker_address]
msg = results[a.worker_address]
assert msg["status"] == "error"
assert msg["exception_text"] == "ValueError('broken')"

Expand Down