summaryrefslogtreecommitdiff
path: root/psutil/tests
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-10-31 15:37:31 +0100
committerGitHub <noreply@github.com>2020-10-31 15:37:31 +0100
commit9aba2efe6cee0a343002d0453674aca68a7b7aec (patch)
tree2b0b95c7711bcba4f3911ea44b9d9846a18380d4 /psutil/tests
parent40abe5c0aa3e258161284b58cedcee1e11a66e75 (diff)
downloadpsutil-9aba2efe6cee0a343002d0453674aca68a7b7aec.tar.gz
Fix py 3.9 [WinError 998] Invalid access to memory location (#1866)
Diffstat (limited to 'psutil/tests')
-rwxr-xr-xpsutil/tests/test_contracts.py5
-rwxr-xr-xpsutil/tests/test_misc.py3
2 files changed, 6 insertions, 2 deletions
diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py
index 72fe8c0c..659dc018 100755
--- a/psutil/tests/test_contracts.py
+++ b/psutil/tests/test_contracts.py
@@ -32,6 +32,7 @@ from psutil import WINDOWS
from psutil._compat import FileNotFoundError
from psutil._compat import long
from psutil._compat import range
+from psutil.tests import APPVEYOR
from psutil.tests import create_sockets
from psutil.tests import enum
from psutil.tests import GITHUB_WHEELS
@@ -451,6 +452,8 @@ class TestFetchAllProcesses(PsutilTestCase):
def name(self, ret, info):
self.assertIsInstance(ret, str)
+ if APPVEYOR and not ret and info['status'] == 'stopped':
+ return
# on AIX, "<exiting>" processes don't have names
if not AIX:
assert ret
@@ -521,6 +524,8 @@ class TestFetchAllProcesses(PsutilTestCase):
def num_threads(self, ret, info):
self.assertIsInstance(ret, int)
+ if APPVEYOR and not ret and info['status'] == 'stopped':
+ return
self.assertGreaterEqual(ret, 1)
def threads(self, ret, info):
diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py
index 8fcee12a..f4e1a5df 100755
--- a/psutil/tests/test_misc.py
+++ b/psutil/tests/test_misc.py
@@ -28,7 +28,6 @@ from psutil._common import wrap_numbers
from psutil._compat import PY3
from psutil.tests import APPVEYOR
from psutil.tests import CI_TESTING
-from psutil.tests import DEVNULL
from psutil.tests import HAS_BATTERY
from psutil.tests import HAS_MEMORY_MAPS
from psutil.tests import HAS_NET_IO_COUNTERS
@@ -719,7 +718,7 @@ class TestScripts(PsutilTestCase):
def test_procsmem(self):
if 'uss' not in psutil.Process().memory_full_info()._fields:
raise self.skipTest("not supported")
- self.assert_stdout('procsmem.py', stderr=DEVNULL)
+ self.assert_stdout('procsmem.py')
def test_killall(self):
self.assert_syntax('killall.py')