diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-15 13:37:54 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-15 13:37:54 +0200 |
commit | 34d1006eb52b134e2f135430c1f25533ce62a00e (patch) | |
tree | 1c7267778b684fd7c0c55b4069794ee8624bf209 | |
parent | d8a1f34108e96a023446a2c9b609b22e3692916a (diff) | |
download | psutil-34d1006eb52b134e2f135430c1f25533ce62a00e.tar.gz |
fix some tests
-rwxr-xr-x | psutil/tests/test_linux.py | 12 | ||||
-rwxr-xr-x | psutil/tests/test_misc.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_testutils.py | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index 709c77ba..eb694c33 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -197,14 +197,14 @@ class TestSystemVirtualMemory(PsutilTestCase): psutil_value = psutil.virtual_memory().total self.assertAlmostEqual(vmstat_value, psutil_value) - # Older versions of procps used slab memory to calculate used memory. - # This got changed in: - # https://gitlab.com/procps-ng/procps/commit/ - # 05d751c4f076a2f0118b914c5e51cfbb4762ad8e - @unittest.skipIf(LINUX and get_free_version_info() < (3, 3, 12), - "old free version") @retry_on_failure() def test_used(self): + # Older versions of procps used slab memory to calculate used memory. + # This got changed in: + # https://gitlab.com/procps-ng/procps/commit/ + # 05d751c4f076a2f0118b914c5e51cfbb4762ad8e + if get_free_version_info() < (3, 3, 12): + raise self.skipTest("old free version") free = free_physmem() free_value = free.used psutil_value = psutil.virtual_memory().used diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py index 300360cd..becd930a 100755 --- a/psutil/tests/test_misc.py +++ b/psutil/tests/test_misc.py @@ -353,7 +353,7 @@ class TestMisc(PsutilTestCase): def test_setup_script(self): setup_py = os.path.join(ROOT_DIR, 'setup.py') - if TRAVIS and not os.path.exists(setup_py): + if CI_TESTING and not os.path.exists(setup_py): return self.skipTest("can't find setup.py") module = import_module_by_path(setup_py) self.assertRaises(SystemExit, module.setup) diff --git a/psutil/tests/test_testutils.py b/psutil/tests/test_testutils.py index b676b76b..901715a1 100755 --- a/psutil/tests/test_testutils.py +++ b/psutil/tests/test_testutils.py @@ -37,6 +37,7 @@ from psutil.tests import PsutilTestCase from psutil.tests import PYTHON_EXE from psutil.tests import reap_children from psutil.tests import retry +from psutil.tests import retry_on_failure from psutil.tests import safe_mkdir from psutil.tests import safe_rmpath from psutil.tests import serialrun @@ -362,6 +363,7 @@ class TestMemLeakClass(TestMemoryLeak): self.assertRaises(ValueError, self.execute, lambda: 0, tolerance=-1) self.assertRaises(ValueError, self.execute, lambda: 0, retries=-1) + @retry_on_failure() def test_leak_mem(self): ls = [] |