@@ -644,8 +644,8 @@ async def test_gather_skip(c, s, a):
644644 x = c .submit (div , 1 , 0 , priority = 10 )
645645 y = c .submit (slowinc , 1 , delay = 0.5 )
646646
647- with captured_logger (logging . getLogger ( "distributed.scheduler" ) ) as sched :
648- with captured_logger (logging . getLogger ( "distributed.client" ) ) as client :
647+ with captured_logger ("distributed.scheduler" ) as sched :
648+ with captured_logger ("distributed.client" ) as client :
649649 L = await c .gather ([x , y ], errors = "skip" )
650650 assert L == [2 ]
651651
@@ -3479,7 +3479,7 @@ async def test_get_foo_lost_keys(c, s, u, v, w):
34793479)
34803480async def test_bad_tasks_fail (c , s , a , b ):
34813481 f = c .submit (sys .exit , 0 )
3482- with captured_logger (logging . getLogger ( "distributed.scheduler" ) ) as logger :
3482+ with captured_logger ("distributed.scheduler" ) as logger :
34833483 with pytest .raises (KilledWorker ) as info :
34843484 await f
34853485
@@ -5015,7 +5015,7 @@ async def test_fire_and_forget_err(c, s, a, b):
50155015
50165016
50175017def test_quiet_client_close (loop ):
5018- with captured_logger (logging . getLogger ( "distributed" ) ) as logger :
5018+ with captured_logger ("distributed" ) as logger :
50195019 with Client (
50205020 loop = loop ,
50215021 processes = False ,
@@ -5041,7 +5041,7 @@ def test_quiet_client_close(loop):
50415041
50425042@pytest .mark .slow
50435043def test_quiet_client_close_when_cluster_is_closed_before_client (loop ):
5044- with captured_logger (logging . getLogger ( "tornado.application" ) ) as logger :
5044+ with captured_logger ("tornado.application" ) as logger :
50455045 cluster = LocalCluster (loop = loop , n_workers = 1 , dashboard_address = ":0" )
50465046 client = Client (cluster , loop = loop )
50475047 cluster .close ()
@@ -5584,7 +5584,7 @@ async def test_profile_keys(c, s, a, b):
55845584
55855585 assert p ["count" ] == xp ["count" ] + yp ["count" ]
55865586
5587- with captured_logger (logging . getLogger ( "distributed" ) ) as logger :
5587+ with captured_logger ("distributed" ) as logger :
55885588 prof = await c .profile ("does-not-exist" )
55895589 assert prof == profile .create ()
55905590 out = logger .getvalue ()
@@ -5839,7 +5839,7 @@ def test_client_doesnt_close_given_loop(loop_in_thread, s, a, b):
58395839@gen_cluster (client = True , nthreads = [])
58405840async def test_quiet_scheduler_loss (c , s ):
58415841 c ._periodic_callbacks ["scheduler-info" ].interval = 10
5842- with captured_logger (logging . getLogger ( "distributed.client" ) ) as logger :
5842+ with captured_logger ("distributed.client" ) as logger :
58435843 await s .close ()
58445844 text = logger .getvalue ()
58455845 assert "BrokenPipeError" not in text
@@ -6335,7 +6335,7 @@ async def test_shutdown_is_quiet_with_cluster():
63356335 async with LocalCluster (
63366336 n_workers = 1 , asynchronous = True , processes = False , dashboard_address = ":0"
63376337 ) as cluster :
6338- with captured_logger (logging . getLogger ( "distributed.client" ) ) as logger :
6338+ with captured_logger ("distributed.client" ) as logger :
63396339 timeout = 0.1
63406340 async with Client (cluster , asynchronous = True , timeout = timeout ) as c :
63416341 await c .shutdown ()
@@ -6349,7 +6349,7 @@ async def test_client_is_quiet_cluster_close():
63496349 async with LocalCluster (
63506350 n_workers = 1 , asynchronous = True , processes = False , dashboard_address = ":0"
63516351 ) as cluster :
6352- with captured_logger (logging . getLogger ( "distributed.client" ) ) as logger :
6352+ with captured_logger ("distributed.client" ) as logger :
63536353 timeout = 0.1
63546354 async with Client (cluster , asynchronous = True , timeout = timeout ) as c :
63556355 await cluster .close ()
@@ -6830,7 +6830,7 @@ def handler(event):
68306830 while len (s .event_subscriber ["test-topic" ]) != 2 :
68316831 await asyncio .sleep (0.01 )
68326832
6833- with captured_logger (logging . getLogger ( "distributed.client" ) ) as logger :
6833+ with captured_logger ("distributed.client" ) as logger :
68346834 await c .log_event ("test-topic" , {})
68356835
68366836 while len (received_events ) < 2 :
@@ -7472,7 +7472,7 @@ def no_message():
74727472 # missing "message" key should log TypeError
74737473 get_worker ().log_event ("warn" , {})
74747474
7475- with captured_logger (logging . getLogger ( "distributed.client" ) ) as log :
7475+ with captured_logger ("distributed.client" ) as log :
74767476 await c .submit (no_message )
74777477 assert "TypeError" in log .getvalue ()
74787478
@@ -7600,7 +7600,7 @@ def print_otherfile():
76007600 # this should log a TypeError in the client
76017601 get_worker ().log_event ("print" , {"args" : ("hello" ,), "file" : "bad value" })
76027602
7603- with captured_logger (logging . getLogger ( "distributed.client" ) ) as log :
7603+ with captured_logger ("distributed.client" ) as log :
76047604 await c .submit (print_otherfile )
76057605 assert "TypeError" in log .getvalue ()
76067606
@@ -7610,7 +7610,7 @@ async def test_print_manual_bad_args(c, s, a, b, capsys):
76107610 def foo ():
76117611 get_worker ().log_event ("print" , {"args" : "not a tuple" })
76127612
7613- with captured_logger (logging . getLogger ( "distributed.client" ) ) as log :
7613+ with captured_logger ("distributed.client" ) as log :
76147614 await c .submit (foo )
76157615 assert "TypeError" in log .getvalue ()
76167616
0 commit comments