MCPcopy Index your code
hub / github.com/python/cpython / testRemoveHandlerAsDecorator

Method testRemoveHandlerAsDecorator

Lib/test/test_unittest/test_break.py:281–290  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

279 self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
280
281 def testRemoveHandlerAsDecorator(self):
282 default_handler = signal.getsignal(signal.SIGINT)
283 unittest.installHandler()
284
285 @unittest.removeHandler
286 def test():
287 self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
288
289 test()
290 self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
291
292@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
293@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")

Callers

nothing calls this directly

Calls 2

testFunction · 0.90
assertNotEqualMethod · 0.80

Tested by

no test coverage detected