@@ -418,31 +418,34 @@ async def abandoned_main(in_host: InHost) -> None:
418
418
with pytest .raises (ZeroDivisionError ):
419
419
trivial_guest_run (abandoned_main )
420
420
421
- with pytest .warns (RuntimeWarning , match = "Trio guest run got abandoned" ):
421
+ with pytest .warns ( # noqa: PT031
422
+ RuntimeWarning ,
423
+ match = "Trio guest run got abandoned" ,
424
+ ):
422
425
do_abandoned_guest_run ()
423
426
gc_collect_harder ()
424
427
425
- # If you have problems some day figuring out what's holding onto a
426
- # reference to the unrolled_run generator and making this test fail,
427
- # then this might be useful to help track it down. (It assumes you
428
- # also hack start_guest_run so that it does 'global W; W =
429
- # weakref(unrolled_run_gen)'.)
430
- #
431
- # import gc
432
- # print(trio._core._run.W)
433
- # targets = [trio._core._run.W()]
434
- # for i in range(15):
435
- # new_targets = []
436
- # for target in targets:
437
- # new_targets += gc.get_referrers(target)
438
- # new_targets.remove(targets)
439
- # print("#####################")
440
- # print(f"depth {i}: {len(new_targets)}")
441
- # print(new_targets)
442
- # targets = new_targets
443
-
444
- with pytest .raises (RuntimeError ):
445
- trio .current_time ()
428
+ # If you have problems some day figuring out what's holding onto a
429
+ # reference to the unrolled_run generator and making this test fail,
430
+ # then this might be useful to help track it down. (It assumes you
431
+ # also hack start_guest_run so that it does 'global W; W =
432
+ # weakref(unrolled_run_gen)'.)
433
+ #
434
+ # import gc
435
+ # print(trio._core._run.W)
436
+ # targets = [trio._core._run.W()]
437
+ # for i in range(15):
438
+ # new_targets = []
439
+ # for target in targets:
440
+ # new_targets += gc.get_referrers(target)
441
+ # new_targets.remove(targets)
442
+ # print("#####################")
443
+ # print(f"depth {i}: {len(new_targets)}")
444
+ # print(new_targets)
445
+ # targets = new_targets
446
+
447
+ with pytest .raises (RuntimeError ):
448
+ trio .current_time ()
446
449
447
450
448
451
def aiotrio_run (
0 commit comments