diff options
author | da-woods <dw-git@d-woods.co.uk> | 2022-09-13 18:26:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 18:26:06 +0100 |
commit | a6e7218aae9ec3b2ca7a9d8be4276e802a480da1 (patch) | |
tree | e5f4f5e4ae4c689dcd3f563c08ed4f247bea4cbe /Tools | |
parent | 9fcf55fa86488bba666e918ba6550e976557411f (diff) | |
download | cython-a6e7218aae9ec3b2ca7a9d8be4276e802a480da1.tar.gz |
Remove dataclass tests that used mutability (#5026)
We accidently made cdef classes mutable in Python 3.10.
@maxbachmann has shown that it's trivially easy to crash them
(e.g. by trying to change the name). Therefore we should make
them immutable.
I included this test from the CPython test-suite because it
seemed to work. However, it relies on a feature that's
unsafe and unintended.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/make_dataclass_tests.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Tools/make_dataclass_tests.py b/Tools/make_dataclass_tests.py index 63cf0a657..0c02f3d14 100644 --- a/Tools/make_dataclass_tests.py +++ b/Tools/make_dataclass_tests.py @@ -17,6 +17,7 @@ unavailable_functions = frozenset( skip_tests = frozenset( { # needs Cython compile + # ==================== ("TestCase", "test_field_default_default_factory_error"), ("TestCase", "test_two_fields_one_default"), ("TestCase", "test_overwrite_hash"), @@ -57,6 +58,7 @@ skip_tests = frozenset( ("TestCase", "test_class_attrs"), ("TestStringAnnotations",), # almost all the texts here use local variables # Currently unsupported + # ===================== ( "TestOrdering", "test_functools_total_ordering", @@ -118,7 +120,10 @@ skip_tests = frozenset( # These tests are probably fine, but the string substitution in this file doesn't get it right ("TestRepr", "test_repr"), ("TestCase", "test_not_in_repr"), + # not possible to add attributes on extension types + ("TestCase", "test_post_init_classmethod"), # Bugs + # ==== ("TestCase", "test_no_options"), # @dataclass() ("TestCase", "test_field_no_default"), # field() ("TestCase", "test_init_in_order"), # field() @@ -166,6 +171,7 @@ skip_tests = frozenset( ("TestCase", "test_init_var_with_default"), # not sure... ("TestReplace", "test_initvar_with_default_value"), # needs investigating # Maybe bugs? + # ========== # non-default argument 'z' follows default argument in dataclass __init__ - this message looks right to me! ("TestCase", "test_class_marker"), # cython.dataclasses.field parameter 'metadata' must be a literal value - possibly not something we can support? @@ -202,10 +208,6 @@ version_specific_skips = { 3, 10, ), # needs language support for | operator on types - ("TestCase", "test_post_init_classmethod"): ( - 3, - 10, - ), # not possible to add attributes on extension types } |