summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-05-17 03:16:26 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2020-05-17 03:16:26 +0200
commit48a507d2f42dd0028908db9973095e3d7af60404 (patch)
tree81c7b0c227a9e20dcb1016002c0fc20e1ceaea02
parent5ad5e8d3f87ef6810dec43a6ac414f7bba5a6db6 (diff)
downloadpsutil-48a507d2f42dd0028908db9973095e3d7af60404.tar.gz
try to fix some failures
-rw-r--r--.github/workflows/build_wheels.yml (renamed from .github/workflows/build_wheel.yml)2
-rw-r--r--psutil/tests/__init__.py2
-rwxr-xr-xpsutil/tests/test_linux.py1
-rwxr-xr-xpsutil/tests/test_system.py3
-rwxr-xr-xpsutil/tests/test_unicode.py5
-rwxr-xr-xsetup.py8
6 files changed, 11 insertions, 10 deletions
diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheels.yml
index 7d230b90..0f922b34 100644
--- a/.github/workflows/build_wheel.yml
+++ b/.github/workflows/build_wheels.yml
@@ -1,4 +1,4 @@
-name: Build wheel
+name: Build wheels
on: [push, pull_request]
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 8a086b6b..e13b6f0f 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -812,7 +812,7 @@ def create_exe(outpath, c_code=None):
os.chmod(outpath, st.st_mode | stat.S_IEXEC)
-def get_testfn(suffix="", dir=None):
+def get_testfn(prefix=TESTFN_PREFIX, suffix="", dir=None):
"""Return an absolute pathname of a file or dir that did not
exist at the time this call is made. Also schedule it for safe
deletion at interpreter exit. It's technically racy but probably
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py
index 9cc518bb..735b4c9e 100755
--- a/psutil/tests/test_linux.py
+++ b/psutil/tests/test_linux.py
@@ -1376,6 +1376,7 @@ class TestMisc(PsutilTestCase):
try:
p = psutil.Process()
tid = p.threads()[1].id
+ self.assertNotEqual(p.pid, tid)
assert not psutil.pid_exists(tid), tid
pt = psutil.Process(tid)
pt.as_dict()
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
index 49eb2d0b..4d00f49a 100755
--- a/psutil/tests/test_system.py
+++ b/psutil/tests/test_system.py
@@ -619,7 +619,8 @@ class TestDiskAPIs(PsutilTestCase):
try:
os.stat(disk.mountpoint)
except OSError as err:
- if (GITHUB_WHEELS or TRAVIS) and MACOS and err.errno == errno.EIO:
+ if (GITHUB_WHEELS or TRAVIS) and \
+ MACOS and err.errno == errno.EIO:
continue
# http://mail.python.org/pipermail/python-dev/
# 2012-June/120787.html
diff --git a/psutil/tests/test_unicode.py b/psutil/tests/test_unicode.py
index ec5ef4e3..38d252dd 100755
--- a/psutil/tests/test_unicode.py
+++ b/psutil/tests/test_unicode.py
@@ -108,7 +108,6 @@ from psutil.tests import spawn_testproc
from psutil.tests import terminate
from psutil.tests import TESTFN_PREFIX
from psutil.tests import TRAVIS
-from psutil.tests import GITHUB_WHEELS
from psutil.tests import UNICODE_SUFFIX
from psutil.tests import unittest
import psutil
@@ -232,7 +231,7 @@ class _BaseFSAPIsTests(object):
@unittest.skipIf(not POSIX, "POSIX only")
def test_proc_connections(self):
suffix = os.path.basename(self.funky_name)
- name = self.get_testfn(suffix=suffix)
+ name = self.get_testfn(prefix="", suffix=suffix)
try:
sock = bind_unix_socket(name)
except UnicodeEncodeError:
@@ -258,7 +257,7 @@ class _BaseFSAPIsTests(object):
raise ValueError("connection not found")
suffix = os.path.basename(self.funky_name)
- name = self.get_testfn(suffix=suffix)
+ name = self.get_testfn(prefix="", suffix=suffix)
try:
sock = bind_unix_socket(name)
except UnicodeEncodeError:
diff --git a/setup.py b/setup.py
index 260df147..ac7b8b53 100755
--- a/setup.py
+++ b/setup.py
@@ -69,10 +69,10 @@ if POSIX:
extras_require = {"test": [
"ipaddress; python_version < '3.0'",
- "mock; python_version < '3.0'",
- "pypiwin32; sys.platform == 'win32'",
- "wmi; sys.platform == 'win32'",
- "enum34; python_version <= '3.4'",]}
+ "mock; python_version < '3.0'",
+ "pypiwin32; sys.platform == 'win32'",
+ "wmi; sys.platform == 'win32'",
+ "enum34; python_version <= '3.4'"]}
def get_version():