コード例 #1
0
ファイル: test_httpservers.py プロジェクト: hacker1405/pip
 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()
コード例 #2
0
ファイル: test_poplib.py プロジェクト: holnessp/cpython
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)
コード例 #3
0
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
コード例 #4
0
ファイル: test_ftplib.py プロジェクト: holnessp/cpython
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)
コード例 #5
0
    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)
コード例 #6
0
ファイル: utils.py プロジェクト: stepchuks9/cpython
    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()
コード例 #7
0
ファイル: test_locks.py プロジェクト: za/cpython
def setUpModule():
    thread_info = threading_helper.threading_setup()
    unittest.addModuleCleanup(threading_helper.threading_cleanup, *thread_info)
コード例 #8
0
 def setUp(self):
     self._threads = threading_helper.threading_setup()
コード例 #9
0
 def setUp(self):
     self._thread_cleanup = threading_helper.threading_setup()
コード例 #10
0
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()
コード例 #11
0
ファイル: fork_wait.py プロジェクト: cparm11/Stonebraker
 def setUp(self):
     self._threading_key = threading_helper.threading_setup()
     self.alive = {}
     self.stop = 0
     self.threads = []
コード例 #12
0
ファイル: utils.py プロジェクト: Krrishdhaneja/cpython
 def setUp(self):
     self._get_running_loop = events._get_running_loop
     events._get_running_loop = lambda: None
     self._thread_cleanup = threading_helper.threading_setup()