diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2023-04-10 23:48:49 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2023-04-10 23:48:49 +0200 |
commit | f11c0552f2bcfc8bc3afa35d29adb4dc5525c092 (patch) | |
tree | 79eadf1f560dcbc4f008975979e04f8e4cfbe57d /psutil/tests/test_system.py | |
parent | 6b8700270e2c32e876dfca081dbbec832aa4e7a0 (diff) | |
parent | 4dd1e215f3d49fb3a5074b82430bf6199c14898e (diff) | |
download | psutil-f11c0552f2bcfc8bc3afa35d29adb4dc5525c092.tar.gz |
merge from master
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'psutil/tests/test_system.py')
-rwxr-xr-x | psutil/tests/test_system.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index 1722b515..c2b1df84 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -123,7 +123,7 @@ class TestProcessAPIs(PsutilTestCase): self.assertFalse(hasattr(p, 'returncode')) @retry_on_failure(30) - def test(procs, callback): + def test_1(procs, callback): gone, alive = psutil.wait_procs(procs, timeout=0.03, callback=callback) self.assertEqual(len(gone), 1) @@ -131,7 +131,7 @@ class TestProcessAPIs(PsutilTestCase): return gone, alive sproc3.terminate() - gone, alive = test(procs, callback) + gone, alive = test_1(procs, callback) self.assertIn(sproc3.pid, [x.pid for x in gone]) if POSIX: self.assertEqual(gone.pop().returncode, -signal.SIGTERM) @@ -142,7 +142,7 @@ class TestProcessAPIs(PsutilTestCase): self.assertFalse(hasattr(p, 'returncode')) @retry_on_failure(30) - def test(procs, callback): + def test_2(procs, callback): gone, alive = psutil.wait_procs(procs, timeout=0.03, callback=callback) self.assertEqual(len(gone), 3) @@ -151,7 +151,7 @@ class TestProcessAPIs(PsutilTestCase): sproc1.terminate() sproc2.terminate() - gone, alive = test(procs, callback) + gone, alive = test_2(procs, callback) self.assertEqual(set(pids), set([sproc1.pid, sproc2.pid, sproc3.pid])) for p in gone: self.assertTrue(hasattr(p, 'returncode')) @@ -165,7 +165,7 @@ class TestProcessAPIs(PsutilTestCase): procs = [psutil.Process(x.pid) for x in (sproc1, sproc2, sproc3)] for p in procs: p.terminate() - gone, alive = psutil.wait_procs(procs) + psutil.wait_procs(procs) def test_pid_exists(self): sproc = self.spawn_testproc() @@ -449,7 +449,7 @@ class TestCpuAPIs(PsutilTestCase): def test_cpu_percent(self): last = psutil.cpu_percent(interval=0.001) - for x in range(100): + for _ in range(100): new = psutil.cpu_percent(interval=None) self._test_cpu_percent(new, last, new) last = new @@ -459,7 +459,7 @@ class TestCpuAPIs(PsutilTestCase): def test_per_cpu_percent(self): last = psutil.cpu_percent(interval=0.001, percpu=True) self.assertEqual(len(last), psutil.cpu_count()) - for x in range(100): + for _ in range(100): new = psutil.cpu_percent(interval=None, percpu=True) for percent in new: self._test_cpu_percent(percent, last, new) @@ -469,7 +469,7 @@ class TestCpuAPIs(PsutilTestCase): def test_cpu_times_percent(self): last = psutil.cpu_times_percent(interval=0.001) - for x in range(100): + for _ in range(100): new = psutil.cpu_times_percent(interval=None) for percent in new: self._test_cpu_percent(percent, last, new) @@ -481,7 +481,7 @@ class TestCpuAPIs(PsutilTestCase): def test_per_cpu_times_percent(self): last = psutil.cpu_times_percent(interval=0.001, percpu=True) self.assertEqual(len(last), psutil.cpu_count()) - for x in range(100): + for _ in range(100): new = psutil.cpu_times_percent(interval=None, percpu=True) for cpu in new: for percent in cpu: |