diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-05 14:20:12 -0700 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-05 14:20:12 -0700 |
commit | d428a88a8662efd3edaa6c8db47d665488a9ab34 (patch) | |
tree | 05a8638efad6a2fcb2e4e02ccd31dd80cdc527de | |
parent | ba8c1b32e82ad9d7e749809bb1cf1cb77da797a5 (diff) | |
download | psutil-d428a88a8662efd3edaa6c8db47d665488a9ab34.tar.gz |
adjust tests for windows
-rw-r--r-- | psutil/tests/__init__.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_memory_leaks.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 30662b8d..a3493736 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -908,7 +908,7 @@ class TestMemoryLeak(PsutilTestCase): automatically skipped. """ # Configurable class attrs. - times = 1200 + times = 1000 warmup_times = 10 tolerance = 4096 # memory retry_for = 3.0 # seconds diff --git a/psutil/tests/test_memory_leaks.py b/psutil/tests/test_memory_leaks.py index f601b429..c63de521 100755 --- a/psutil/tests/test_memory_leaks.py +++ b/psutil/tests/test_memory_leaks.py @@ -500,22 +500,31 @@ class TestUnclosedFdsOrHandles(TestFdsLeak): p = psutil.Process() ns = process_namespace(p) for fun, name in ns.iter(ns.getters + ns.setters): + if WINDOWS: + fun() self.execute(fun) def test_process_apis_nsp(self): def wrapper(fun): - self.assertRaises(psutil.NoSuchProcess, fun) + try: + fun() + except psutil.NoSuchProcess: + pass p = psutil.Process(self.spawn_testproc().pid) p.terminate() p.wait() ns = process_namespace(p) for fun, name in ns.iter(ns.getters + ns.setters + ns.killers): + if WINDOWS: + wrapper(fun) self.execute(lambda: wrapper(fun)) def test_system_apis(self): ns = system_namespace for fun, name in ns.iter(ns.all): + if WINDOWS: + fun() self.execute(fun) |