def setUp(self): super().setUp() env = os.environ.copy() env["THINK_OF_A_NUMBER"] = str(os.getpid()) self.proc32 = self.spawn_testproc([self.python32] + self.test_args, env=env, stdin=subprocess.PIPE) self.proc64 = self.spawn_testproc([self.python64] + self.test_args, env=env, stdin=subprocess.PIPE)
def _run(self, suite): try: result = super().run(suite) except (KeyboardInterrupt, SystemExit): result = self.runner.result result.printErrors() raise sys.exit(1) else: self._save_result(result) return result
def setUp(self): super().setUp() other_python = self.find_other_interpreter() if other_python is None: raise unittest.SkipTest( "could not find interpreter with opposite bitness") if IS_64BIT: self.python64 = sys.executable self.python32 = other_python else: self.python64 = other_python self.python32 = sys.executable env = os.environ.copy() env["THINK_OF_A_NUMBER"] = str(os.getpid()) self.proc32 = self.spawn_testproc([self.python32] + self.test_args, env=env, stdin=subprocess.PIPE) self.proc64 = self.spawn_testproc([self.python64] + self.test_args, env=env, stdin=subprocess.PIPE)
def tearDownClass(cls): super().tearDownClass() reap_children()
def setUpClass(cls): super().setUpClass() p = get_test_subprocess() cls.proc = psutil.Process(p.pid) cls.proc.kill() cls.proc.wait()
def _makeResult(self): # Store result instance so that it can be accessed on # KeyboardInterrupt. self.result = super()._makeResult() return self.result
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.failed_tnames = set()
def printErrorList(self, flavour, errors): flavour = hilite(flavour, "red", bold=flavour == 'ERROR') super().printErrorList(flavour, errors)
def tearDown(self): super().tearDown() self.proc32.communicate() self.proc64.communicate()
def tearDownClass(cls): super().tearDownClass() terminate(cls.subp)
def setUpClass(cls): super().setUpClass() cls.subp = spawn_testproc() cls.proc = psutil.Process(cls.subp.pid) cls.proc.kill() cls.proc.wait()
def __init__(self): super().__init__() self._running = False self._interval = 0.001 self._flag = threading.Event()