Python unittest.removeHandler() Examples

The following are 30 code examples of unittest.removeHandler(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module unittest , or try the search function .
Example #1
Source File: test_break.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #2
Source File: runner.py    From python with Apache License 2.0 5 votes vote down vote up
def stopTest(self, test):
        super(DebugSQLTextTestResult, self).stopTest(test)
        self.logger.removeHandler(self.handler)
        if self.showAll:
            self.debug_sql_stream.seek(0)
            self.stream.write(self.debug_sql_stream.read())
            self.stream.writeln(self.separator2) 
Example #3
Source File: runner.py    From python with Apache License 2.0 5 votes vote down vote up
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment() 
Example #4
Source File: runner.py    From openhgsenti with Apache License 2.0 5 votes vote down vote up
def stopTest(self, test):
        super(DebugSQLTextTestResult, self).stopTest(test)
        self.logger.removeHandler(self.handler)
        if self.showAll:
            self.debug_sql_stream.seek(0)
            self.stream.write(self.debug_sql_stream.read())
            self.stream.writeln(self.separator2) 
Example #5
Source File: runner.py    From openhgsenti with Apache License 2.0 5 votes vote down vote up
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment() 
Example #6
Source File: runner.py    From python2017 with MIT License 5 votes vote down vote up
def stopTest(self, test):
        super(DebugSQLTextTestResult, self).stopTest(test)
        self.logger.removeHandler(self.handler)
        if self.showAll:
            self.debug_sql_stream.seek(0)
            self.stream.write(self.debug_sql_stream.read())
            self.stream.writeln(self.separator2) 
Example #7
Source File: runner.py    From python2017 with MIT License 5 votes vote down vote up
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment() 
Example #8
Source File: test_break.py    From datafari with Apache License 2.0 5 votes vote down vote up
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 #9
Source File: test_break.py    From datafari with Apache License 2.0 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #10
Source File: test_break.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
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 #11
Source File: runner.py    From Hands-On-Application-Development-with-PyCharm with MIT License 5 votes vote down vote up
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment() 
Example #12
Source File: test_break.py    From odoo13-x64 with GNU General Public License v3.0 5 votes vote down vote up
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 #13
Source File: test_break.py    From odoo13-x64 with GNU General Public License v3.0 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #14
Source File: test_break.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
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 #15
Source File: test_break.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #16
Source File: test_break.py    From android_universal with MIT License 5 votes vote down vote up
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 #17
Source File: test_break.py    From android_universal with MIT License 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #18
Source File: test_break.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
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 #19
Source File: test_break.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #20
Source File: test_break.py    From oss-ftp with MIT License 5 votes vote down vote up
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 #21
Source File: test_break.py    From jawfish with MIT License 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #22
Source File: runner.py    From GTDWeb with GNU General Public License v2.0 5 votes vote down vote up
def stopTest(self, test):
        super(DebugSQLTextTestResult, self).stopTest(test)
        self.logger.removeHandler(self.handler)
        if self.showAll:
            self.debug_sql_stream.seek(0)
            self.stream.write(self.debug_sql_stream.read())
            self.stream.writeln(self.separator2) 
Example #23
Source File: runner.py    From GTDWeb with GNU General Public License v2.0 5 votes vote down vote up
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment() 
Example #24
Source File: test_break.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
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 #25
Source File: test_break.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #26
Source File: runner.py    From bioforum with MIT License 5 votes vote down vote up
def stopTest(self, test):
        super().stopTest(test)
        self.logger.removeHandler(self.handler)
        if self.showAll:
            self.debug_sql_stream.seek(0)
            self.stream.write(self.debug_sql_stream.read())
            self.stream.writeln(self.separator2) 
Example #27
Source File: runner.py    From bioforum with MIT License 5 votes vote down vote up
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment() 
Example #28
Source File: test_break.py    From BinderFilter with MIT License 5 votes vote down vote up
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 #29
Source File: test_break.py    From BinderFilter with MIT License 5 votes vote down vote up
def testRemoveHandlerAsDecorator(self):
        default_handler = signal.getsignal(signal.SIGINT)
        unittest.installHandler()

        @unittest.removeHandler
        def test():
            self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)

        test()
        self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler) 
Example #30
Source File: test_break.py    From jawfish with MIT License 5 votes vote down vote up
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)