Example #1
0
 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)
Example #2
0
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
Example #3
0
    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)
Example #4
0
 def teardown_test_environment(self, **kwargs):
     unittest.removeHandler()
     teardown_test_environment()
Example #5
0
 def teardown_test_environment(self, **kwargs):
     unittest.removeHandler()
     teardown_test_environment()
Example #6
0
import collections
Example #7
0
 def deinit(self):
     unittest.removeHandler()