File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 1212
1313
1414@pytest .fixture (scope = "session" , autouse = True )
15- def disable_actor_auto_restart (): # type: ignore
16- """Disable auto-restart of actors while running tests.
17-
18- At some point we had a version that would set the limit back to the
19- original value but it doesn't work because some actors will keep running
20- even after the end of the session and fail after the original value was
21- reestablished, getting into an infinite loop again.
22-
23- Note: Test class must derive after unittest.IsolatedAsyncioTestCase.
24- Otherwise this fixture won't run.
25- """
26- _actor .Actor ._restart_limit = 0 # pylint: disable=protected-access
15+ def disable_actor_auto_restart () -> collections .abc .Iterator [None ]:
16+ """Disable auto-restart of actors while running tests."""
17+ # pylint: disable=protected-access
18+ original_limit = _actor .Actor ._restart_limit
19+ _actor .Actor ._restart_limit = 0
20+ yield
21+ _actor .Actor ._restart_limit = original_limit
You can’t perform that action at this time.
0 commit comments