restore cython flag value to default after test

pull/17642/head
Eric Gribkoff 6 years ago
parent 2dda0bb21b
commit 4b2086eecd
  1. 4
      src/python/grpcio_tests/tests/unit/_cython/_fork_test.py

@ -27,6 +27,7 @@ def _get_number_active_threads():
class ForkPosixTester(unittest.TestCase): class ForkPosixTester(unittest.TestCase):
def setUp(self): def setUp(self):
self._saved_fork_support_flag = cygrpc._GRPC_ENABLE_FORK_SUPPORT
cygrpc._GRPC_ENABLE_FORK_SUPPORT = True cygrpc._GRPC_ENABLE_FORK_SUPPORT = True
def testForkManagedThread(self): def testForkManagedThread(self):
@ -50,6 +51,9 @@ class ForkPosixTester(unittest.TestCase):
thread.join() thread.join()
self.assertEqual(0, _get_number_active_threads()) self.assertEqual(0, _get_number_active_threads())
def tearDown(self):
cygrpc._GRPC_ENABLE_FORK_SUPPORT = self._saved_fork_support_flag
@unittest.skipUnless(os.name == 'nt', 'Windows-specific tests') @unittest.skipUnless(os.name == 'nt', 'Windows-specific tests')
class ForkWindowsTester(unittest.TestCase): class ForkWindowsTester(unittest.TestCase):

Loading…
Cancel
Save