2020-08-16 20:02:12 +00:00
|
|
|
import platform
|
|
|
|
import sys
|
2024-06-18 20:54:38 +00:00
|
|
|
import sysconfig
|
2020-08-16 20:02:12 +00:00
|
|
|
|
2021-04-02 18:34:09 +00:00
|
|
|
import pytest
|
|
|
|
|
2020-08-16 20:02:12 +00:00
|
|
|
LINUX = sys.platform.startswith("linux")
|
|
|
|
MACOS = sys.platform.startswith("darwin")
|
|
|
|
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")
|
|
|
|
|
|
|
|
CPYTHON = platform.python_implementation() == "CPython"
|
|
|
|
PYPY = platform.python_implementation() == "PyPy"
|
2024-06-18 20:54:38 +00:00
|
|
|
PY_GIL_DISABLED = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
|
2020-08-16 20:02:12 +00:00
|
|
|
|
2021-04-02 18:34:09 +00:00
|
|
|
|
|
|
|
def deprecated_call():
|
|
|
|
"""
|
|
|
|
pytest.deprecated_call() seems broken in pytest<3.9.x; concretely, it
|
|
|
|
doesn't work on CPython 3.8.0 with pytest==3.3.2 on Ubuntu 18.04 (#2922).
|
|
|
|
|
|
|
|
This is a narrowed reimplementation of the following PR :(
|
|
|
|
https://github.com/pytest-dev/pytest/pull/4104
|
|
|
|
"""
|
|
|
|
# TODO: Remove this when testing requires pytest>=3.9.
|
|
|
|
pieces = pytest.__version__.split(".")
|
|
|
|
pytest_major_minor = (int(pieces[0]), int(pieces[1]))
|
|
|
|
if pytest_major_minor < (3, 9):
|
|
|
|
return pytest.warns((DeprecationWarning, PendingDeprecationWarning))
|
2023-02-22 14:18:55 +00:00
|
|
|
return pytest.deprecated_call()
|