def setUp(self): self._threads = threading_helper.threading_setup() os.environ = support.EnvironmentVarGuard() self.server_started = threading.Event() self.thread = TestServerThread(self, self.request_handler) self.thread.start() self.server_started.wait()
def test_main(): tests = [TestPOP3Class, TestTimeouts, TestPOP3_SSLClass, TestPOP3_TLSClass] thread_info = threading_helper.threading_setup() try: test_support.run_unittest(*tests) finally: threading_helper.threading_cleanup(*thread_info)
def setUpModule(): thread_info = threading_helper.threading_setup() unittest.addModuleCleanup(threading_helper.threading_cleanup, *thread_info) try: old_switchinterval = sys.getswitchinterval() unittest.addModuleCleanup(sys.setswitchinterval, old_switchinterval) sys.setswitchinterval(1e-5) except AttributeError: pass
def test_main(): tests = [ TestFTPClass, TestTimeouts, TestIPv6Environment, TestTLS_FTPClassMixin, TestTLS_FTPClass, MiscTestCase ] thread_info = threading_helper.threading_setup() try: support.run_unittest(*tests) finally: threading_helper.threading_cleanup(*thread_info)
def setUp(self): self.done_mutex = thread.allocate_lock() self.done_mutex.acquire() self.running_mutex = thread.allocate_lock() self.random_mutex = thread.allocate_lock() self.created = 0 self.running = 0 self.next_ident = 0 key = threading_helper.threading_setup() self.addCleanup(threading_helper.threading_cleanup, *key)
def setUp(self): self._get_running_loop = events._get_running_loop def _get_running_loop(): frame = sys._getframe(1) if frame.f_globals['__name__'] == 'asyncio.mixins': # When we called from LoopBoundedMixin we should # fallback to default implementation of get_running_loop try: return events.get_running_loop() except RuntimeError: return None return None events._get_running_loop = _get_running_loop self._thread_cleanup = threading_helper.threading_setup()
def setUpModule(): thread_info = threading_helper.threading_setup() unittest.addModuleCleanup(threading_helper.threading_cleanup, *thread_info)
def setUp(self): self._threads = threading_helper.threading_setup()
def setUp(self): self._thread_cleanup = threading_helper.threading_setup()
def setUpModule(): # Store the threading_setup in a key and ensure that it is cleaned up # in the tearDown global threads_key threads_key = threading_helper.threading_setup()
def setUp(self): self._threading_key = threading_helper.threading_setup() self.alive = {} self.stop = 0 self.threads = []
def setUp(self): self._get_running_loop = events._get_running_loop events._get_running_loop = lambda: None self._thread_cleanup = threading_helper.threading_setup()