summaryrefslogtreecommitdiff
path: root/tests/run/tuple_constants.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/tuple_constants.pyx')
-rw-r--r--tests/run/tuple_constants.pyx7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/run/tuple_constants.pyx b/tests/run/tuple_constants.pyx
index f60d5d818..fa5794cf7 100644
--- a/tests/run/tuple_constants.pyx
+++ b/tests/run/tuple_constants.pyx
@@ -36,7 +36,12 @@ def test_deduplicated_args():
# are generated often with the same argument names. Therefore it's worth ensuring that
# they are correctly deduplicated
import sys
- if not hasattr(sys, "pypy_version_info"): # test doesn't work on PyPy (which is probably fair enough)
+ check_identity_of_co_varnames = (
+ not hasattr(sys, "pypy_version_info") and # test doesn't work on PyPy (which is probably fair enough)
+ sys.version_info < (3, 11) # on Python 3.11 co_varnames returns a new, dynamically-calculated tuple
+ # each time it is run
+ )
+ if check_identity_of_co_varnames:
assert func1.__code__.co_varnames is func2.__code__.co_varnames
@cython.test_assert_path_exists("//TupleNode",