Skip to content

Commit

Permalink
Skip memray on pypy (#3286)
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
  • Loading branch information
ecerulm and pquentin committed Jan 23, 2024
1 parent 6b2b377 commit 03f7b65
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ def tests_impl(
session.run("python", "-c", "import struct; print(struct.calcsize('P') * 8)")
# Print OpenSSL information.
session.run("python", "-m", "OpenSSL.debug")
# Retrieve sys info from the Python implementation under test
# to avoid enabling memray when nox runs under CPython but tests PyPy
session_python_info = session.run(
"python",
"-c",
"import sys; print(sys.implementation.name, sys.version_info.releaselevel)",
silent=True,
).strip() # type: ignore[union-attr] # mypy doesn't know that silent=True will return a string
implementation_name, release_level = session_python_info.split(" ")

memray_supported = True
if sys.implementation.name != "cpython" or sys.version_info.releaselevel != "final":
if implementation_name != "cpython" or release_level != "final":
memray_supported = False # pytest-memray requires CPython 3.8+
elif sys.platform == "win32":
memray_supported = False
Expand Down

0 comments on commit 03f7b65

Please sign in to comment.