summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-04-25 12:59:04 +0200
committerSebastian Berg <sebastianb@nvidia.com>2023-04-25 13:32:51 +0200
commit5019e0abc3eda9bbfbead97b08b4302da2c31437 (patch)
treecfd76b43d837c13a82f81aa11cfc113f3cd8e97d
parent61610e74340a4a22f2782274600ae34bd882b929 (diff)
downloadnumpy-5019e0abc3eda9bbfbead97b08b4302da2c31437.tar.gz
TST: Skip test on older Python versions which use `__name__`
-rw-r--r--numpy/core/tests/test_overrides.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_overrides.py b/numpy/core/tests/test_overrides.py
index 65155b207..5924358ea 100644
--- a/numpy/core/tests/test_overrides.py
+++ b/numpy/core/tests/test_overrides.py
@@ -389,6 +389,12 @@ class TestArrayFunctionImplementation:
func(bad_arg=3)
raise AssertionError("must fail")
except TypeError as exc:
+ if exc.args[0].startswith("_dispatcher"):
+ # We replace the qualname currently, but it used `__name__`
+ # (relevant functions have the same name and qualname anyway)
+ pytest.skip("Python version is not using __qualname__ for "
+ "TypeError formatting.")
+
assert exc.args == expected_exception.args
@pytest.mark.parametrize("value", [234, "this func is not replaced"])