MCPcopy
hub / github.com/celery/celery / test_gc_race_lost

Method test_gc_race_lost

t/unit/utils/test_timer2.py:75–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73 _exit.assert_called_with(1)
74
75 def test_gc_race_lost(self):
76 t = timer2.Timer()
77 with patch.object(t, "_Timer__is_stopped") as mock_stop_event:
78 # Mark the timer as shutting down so we escape the run loop,
79 # mocking the running state so we don't block!
80 with patch.object(t, "running", new=False):
81 t.stop()
82 # Pretend like the interpreter has shutdown and GCed built-in
83 # modules, causing an exception
84 mock_stop_event.set.side_effect = TypeError()
85 t.run()
86 mock_stop_event.set.assert_called_with()
87
88 def test_test_enter(self):
89 t = timer2.Timer()

Callers

nothing calls this directly

Calls 3

stopMethod · 0.95
runMethod · 0.95
objectMethod · 0.80

Tested by

no test coverage detected