MCPcopy
hub / github.com/tornadoweb/tornado / test_remove_timeout_cleanup

Method test_remove_timeout_cleanup

tornado/test/ioloop_test.py:190–201  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 self.io_loop.remove_timeout(handle)
189
190 def test_remove_timeout_cleanup(self):
191 # Add and remove enough callbacks to trigger cleanup.
192 # Not a very thorough test, but it ensures that the cleanup code
193 # gets executed and doesn't blow up. This test is only really useful
194 # on PollIOLoop subclasses, but it should run silently on any
195 # implementation.
196 for i in range(2000):
197 timeout = self.io_loop.add_timeout(self.io_loop.time() + 3600, lambda: None)
198 self.io_loop.remove_timeout(timeout)
199 # HACK: wait two IOLoop iterations for the GC to happen.
200 self.io_loop.add_callback(lambda: self.io_loop.add_callback(self.stop))
201 self.wait()
202
203 def test_remove_timeout_from_timeout(self):
204 calls = [False, False]

Callers

nothing calls this directly

Calls 5

add_timeoutMethod · 0.80
timeMethod · 0.80
remove_timeoutMethod · 0.45
add_callbackMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected