mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 14:59:27 +00:00
Replace env.deprecated_call() with pytest.deprecated_call() (#5893)
Since we already require pytest>=6 (see tests/requirements.txt), the old compatibility function is obsolete and pytest.deprecated_call() can be used directly. Extracted from PR #5879 Co-authored-by: Michael Carlstrom <rmc@carlstrom.com> Co-authored-by: gentlegiantJGC <gentlegiantJGC@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3370fe14b7
commit
b30e72c6f6
18
tests/env.py
18
tests/env.py
@@ -4,8 +4,6 @@ import platform
|
||||
import sys
|
||||
import sysconfig
|
||||
|
||||
import pytest
|
||||
|
||||
ANDROID = sys.platform.startswith("android")
|
||||
LINUX = sys.platform.startswith("linux")
|
||||
MACOS = sys.platform.startswith("darwin")
|
||||
@@ -29,19 +27,3 @@ TYPES_ARE_IMMORTAL = (
|
||||
or GRAALPY
|
||||
or (CPYTHON and PY_GIL_DISABLED and (3, 13) <= sys.version_info < (3, 14))
|
||||
)
|
||||
|
||||
|
||||
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))
|
||||
return pytest.deprecated_call()
|
||||
|
||||
Reference in New Issue
Block a user