File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ def check(
332332 expected : _EXPECTED_T ,
333333 ) -> bool :
334334 if sys .version_info < (3 , 10 ) and env .CPYTHON :
335- with pytest .deprecated_call ():
335+ with env .deprecated_call ():
336336 return convert (value ) == expected
337337 else :
338338 return convert (value ) == expected
Original file line number Diff line number Diff line change 33import platform
44import sys
55import sysconfig
6+ from typing import Any
7+
8+ import pytest
69
710ANDROID = sys .platform .startswith ("android" )
811LINUX = sys .platform .startswith ("linux" )
2730 or GRAALPY
2831 or (CPYTHON and PY_GIL_DISABLED and (3 , 13 ) <= sys .version_info < (3 , 14 ))
2932)
33+
34+
35+ def deprecated_call () -> Any :
36+ """
37+ pytest.deprecated_call() seems broken in pytest<3.9.x; concretely, it
38+ doesn't work on CPython 3.8.0 with pytest==3.3.2 on Ubuntu 18.04 (#2922).
39+
40+ This is a narrowed reimplementation of the following PR :(
41+ https://github.com/pytest-dev/pytest/pull/4104
42+ """
43+ # TODO: Remove this when testing requires pytest>=3.9.
44+ pieces = pytest .__version__ .split ("." )
45+ pytest_major_minor = (int (pieces [0 ]), int (pieces [1 ]))
46+ if pytest_major_minor < (3 , 9 ):
47+ return pytest .warns ((DeprecationWarning , PendingDeprecationWarning ))
48+ return pytest .deprecated_call ()
You can’t perform that action at this time.
0 commit comments