Skip to content

Commit

Permalink
skip parts of generic_alias test on PyPy3.9-v7.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Apr 5, 2022
1 parent 128fa6f commit 0fea286
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions numpy/typing/tests/test_generic_alias.py
Expand Up @@ -17,7 +17,10 @@
DType = _GenericAlias(np.dtype, (ScalarType,))
NDArray = _GenericAlias(np.ndarray, (Any, DType))

if sys.version_info >= (3, 9):
_SKIP_PYPY_39 = (sys.implementation.name == 'pypy' and
sys.implementation.version < (7, 3, 10))

if sys.version_info >= (3, 9) and not _SKIP_PYPY_39:
DType_ref = types.GenericAlias(np.dtype, (ScalarType,))
NDArray_ref = types.GenericAlias(np.ndarray, (Any, DType_ref))
FuncType = Callable[[Union[_GenericAlias, types.GenericAlias]], Any]
Expand Down Expand Up @@ -77,7 +80,7 @@ def test_pass(self, name: str, func: FuncType) -> None:
"""
value = func(NDArray)

if sys.version_info >= (3, 9):
if sys.version_info >= (3, 9) and not _SKIP_PYPY_39:
value_ref = func(NDArray_ref)
assert value == value_ref

Expand Down Expand Up @@ -139,6 +142,6 @@ def test_raise(
with pytest.raises(exc_type):
func(NDArray)

if sys.version_info >= (3, 9):
if sys.version_info >= (3, 9) and not _SKIP_PYPY_39:
with pytest.raises(exc_type):
func(NDArray_ref)

0 comments on commit 0fea286

Please sign in to comment.