Skip to content

Commit

Permalink
chore: skip test_weird_environ on macOS 11+
Browse files Browse the repository at this point in the history
Signed-off-by: mayeut <mayeut@users.noreply.github.com>
  • Loading branch information
mayeut committed Sep 25, 2022
1 parent 729e023 commit 3cbc094
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import gc
import inspect
import os
import platform
import random
import re
import select
Expand Down Expand Up @@ -84,7 +85,7 @@
"HAS_CPU_AFFINITY", "HAS_CPU_FREQ", "HAS_ENVIRON", "HAS_PROC_IO_COUNTERS",
"HAS_IONICE", "HAS_MEMORY_MAPS", "HAS_PROC_CPU_NUM", "HAS_RLIMIT",
"HAS_SENSORS_BATTERY", "HAS_BATTERY", "HAS_SENSORS_FANS",
"HAS_SENSORS_TEMPERATURES", "HAS_MEMORY_FULL_INFO",
"HAS_SENSORS_TEMPERATURES", "HAS_MEMORY_FULL_INFO", "MACOS_11PLUS",
# subprocesses
'pyrun', 'terminate', 'reap_children', 'spawn_testproc', 'spawn_zombie',
'spawn_children_pair',
Expand Down Expand Up @@ -127,6 +128,11 @@
CI_TESTING = APPVEYOR or GITHUB_ACTIONS
# are we a 64 bit process?
IS_64BIT = sys.maxsize > 2 ** 32
if MACOS:
_macos_version = platform.mac_ver()[0]
MACOS_11PLUS = tuple(map(int, _macos_version.split(".")[:2])) > (10, 15)
else:
MACOS_11PLUS = False


# --- configurable defaults
Expand Down
2 changes: 2 additions & 0 deletions psutil/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from psutil.tests import HAS_PROC_IO_COUNTERS
from psutil.tests import HAS_RLIMIT
from psutil.tests import HAS_THREADS
from psutil.tests import MACOS_11PLUS
from psutil.tests import PYPY
from psutil.tests import PYTHON_EXE
from psutil.tests import PsutilTestCase
Expand Down Expand Up @@ -1426,6 +1427,7 @@ def clean_dict(d):

@unittest.skipIf(not HAS_ENVIRON, "not supported")
@unittest.skipIf(not POSIX, "POSIX only")
@unittest.skipIf(MACOS_11PLUS, "macOS 11+ not supported, issue #2084")
def test_weird_environ(self):
# environment variables can contain values without an equals sign
code = textwrap.dedent("""
Expand Down

0 comments on commit 3cbc094

Please sign in to comment.