コード例 #1
0
 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)
コード例 #2
0
 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
コード例 #3
0
    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)
コード例 #4
0
 def tearDownClass(cls):
     super().tearDownClass()
     reap_children()
コード例 #5
0
 def setUpClass(cls):
     super().setUpClass()
     p = get_test_subprocess()
     cls.proc = psutil.Process(p.pid)
     cls.proc.kill()
     cls.proc.wait()
コード例 #6
0
 def _makeResult(self):
     # Store result instance so that it can be accessed on
     # KeyboardInterrupt.
     self.result = super()._makeResult()
     return self.result
コード例 #7
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.failed_tnames = set()
コード例 #8
0
 def printErrorList(self, flavour, errors):
     flavour = hilite(flavour, "red", bold=flavour == 'ERROR')
     super().printErrorList(flavour, errors)
コード例 #9
0
 def tearDown(self):
     super().tearDown()
     self.proc32.communicate()
     self.proc64.communicate()
コード例 #10
0
ファイル: test_memleaks.py プロジェクト: hugovk/psutil
 def tearDownClass(cls):
     super().tearDownClass()
     terminate(cls.subp)
コード例 #11
0
ファイル: test_memleaks.py プロジェクト: hugovk/psutil
 def setUpClass(cls):
     super().setUpClass()
     cls.subp = spawn_testproc()
     cls.proc = psutil.Process(cls.subp.pid)
     cls.proc.kill()
     cls.proc.wait()
コード例 #12
0
ファイル: __init__.py プロジェクト: disasterbyte/psutil
 def __init__(self):
     super().__init__()
     self._running = False
     self._interval = 0.001
     self._flag = threading.Event()