diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-25 18:46:03 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-25 18:46:03 +0200 |
commit | 378b116d312c6e1b7703e221056b9e5003876723 (patch) | |
tree | 85fcfd3e8d6d409a7d86d8a2a86a6b33d53ca0f1 | |
parent | 81d49e1474b19f6a3b11aa805cc6790e06b14165 (diff) | |
download | psutil-378b116d312c6e1b7703e221056b9e5003876723.tar.gz |
run process tests serially
-rwxr-xr-x | psutil/tests/runner.py | 3 | ||||
-rwxr-xr-x | psutil/tests/test_linux.py | 1 | ||||
-rwxr-xr-x | psutil/tests/test_process.py | 5 | ||||
-rwxr-xr-x | psutil/tests/test_system.py | 9 |
4 files changed, 4 insertions, 14 deletions
diff --git a/psutil/tests/runner.py b/psutil/tests/runner.py index ffedb715..72dd6f69 100755 --- a/psutil/tests/runner.py +++ b/psutil/tests/runner.py @@ -58,8 +58,7 @@ loadTestsFromTestCase = unittest.defaultTestLoader.loadTestsFromTestCase class ColouredResult(TextTestResult): def _print_color(self, s, color, bold=False): - file = sys.stderr if color == "red" else sys.stdout - print_color(s, color, bold=bold, file=file) + print_color(s, color, bold=bold, file=self.stream) def addSuccess(self, test): TestResult.addSuccess(self, test) diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index a064be5d..4cb3d3af 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -1643,6 +1643,7 @@ class TestSensorsFans(unittest.TestCase): @unittest.skipIf(not LINUX, "LINUX only") class TestProcess(unittest.TestCase): + @retry_on_failure() def test_memory_full_info(self): testfn = get_testfn() src = textwrap.dedent(""" diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index 0f3f4164..8095fc04 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -57,7 +57,6 @@ from psutil.tests import PYPY from psutil.tests import PYTHON_EXE from psutil.tests import reap_children from psutil.tests import retry_on_failure -from psutil.tests import serialrun from psutil.tests import sh from psutil.tests import skip_on_access_denied from psutil.tests import skip_on_not_implemented @@ -71,7 +70,7 @@ from psutil.tests import wait_for_pid # --- psutil.Process class tests # =================================================================== -@serialrun + class TestProcess(unittest.TestCase): """Tests for psutil.Process class.""" @@ -297,7 +296,7 @@ class TestProcess(unittest.TestCase): @unittest.skipIf(TRAVIS or CIRRUS, 'not reliable on TRAVIS/CIRRUS') def test_terminal(self): terminal = psutil.Process().terminal() - if sys.stdin.isatty() or sys.stdout.isatty(): + if sys.stdout.isatty(): tty = os.path.realpath(sh('tty')) self.assertEqual(terminal, tty) else: diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index 21d24b79..f5d9f49e 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -48,7 +48,6 @@ from psutil.tests import mock from psutil.tests import PYPY from psutil.tests import reap_children from psutil.tests import retry_on_failure -from psutil.tests import serialrun from psutil.tests import TRAVIS from psutil.tests import UNICODE_SUFFIX from psutil.tests import unittest @@ -59,7 +58,6 @@ from psutil.tests import unittest # =================================================================== -@serialrun class TestProcessAPIs(unittest.TestCase): def tearDown(self): @@ -196,13 +194,6 @@ class TestProcessAPIs(unittest.TestCase): for pid in pids: self.assertFalse(psutil.pid_exists(pid), msg=pid) - def test_pids(self): - pidslist = psutil.pids() - procslist = [x.pid for x in psutil.process_iter()] - # make sure every pid is unique - self.assertEqual(sorted(set(pidslist)), pidslist) - self.assertEqual(pidslist, procslist) - class TestMiscAPIs(unittest.TestCase): |