本文整理汇总了Python中unittest.removeHandler函数的典型用法代码示例。如果您正苦于以下问题:Python removeHandler函数的具体用法?Python removeHandler怎么用?Python removeHandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了removeHandler函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRemoveHandler
def testRemoveHandler(self):
default_handler = signal.getsignal(signal.SIGINT)
unittest.installHandler()
unittest.removeHandler()
self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
unittest.removeHandler()
self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
示例2: run_tests
def run_tests(file):
suite = get_tests_suite(file)
unittest.installHandler()
logging.disable(logging.INFO)
results = unittest.TextTestRunner(verbosity=2).run(suite)
logging.disable(logging.NOTSET)
unittest.removeHandler()
return results
示例3: testRemoveHandler
def testRemoveHandler(self):
default_handler = signal.getsignal(signal.SIGINT)
unittest.installHandler()
unittest.removeHandler()
self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
# check that calling removeHandler multiple times has no ill-effect
unittest.removeHandler()
self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
示例4: teardown_test_environment
def teardown_test_environment(self, **kwargs):
unittest.removeHandler()
teardown_test_environment()
示例5: deinit
def deinit(self):
unittest.removeHandler()