summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorda-woods <dw-git@d-woods.co.uk>2022-09-24 11:24:38 +0100
committerGitHub <noreply@github.com>2022-09-24 11:24:38 +0100
commitab1053b2b1171664038488cb6721b9e407fe5679 (patch)
tree806497f6fb61eefee24fa74c40f320b299541dab /Tools
parent230d5083704d8d7fe32f1998dcc375b18752b8f8 (diff)
downloadcython-ab1053b2b1171664038488cb6721b9e407fe5679.tar.gz
Fix arguments like `init=False` being ignored in dataclasses (#4958)
Fixes some of https://github.com/cython/cython/issues/4956
Diffstat (limited to 'Tools')
-rw-r--r--Tools/make_dataclass_tests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Tools/make_dataclass_tests.py b/Tools/make_dataclass_tests.py
index 0c02f3d14..6a3cee7ac 100644
--- a/Tools/make_dataclass_tests.py
+++ b/Tools/make_dataclass_tests.py
@@ -120,6 +120,12 @@ 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"),
+ ('TestRepr', 'test_no_repr'),
+ # class variable doesn't exist in Cython so uninitialized variable appears differently - for now this is deliberate
+ ('TestInit', 'test_no_init'),
+ # I believe the test works but the ordering functions do appear in the class dict (and default slot wrappers which
+ # just raise NotImplementedError
+ ('TestOrdering', 'test_no_order'),
# not possible to add attributes on extension types
("TestCase", "test_post_init_classmethod"),
# Bugs
@@ -139,18 +145,14 @@ skip_tests = frozenset(
("TestReplace", "test_recursive_repr_misc_attrs"), # recursion error
("TestReplace", "test_recursive_repr_indirection"), # recursion error
("TestReplace", "test_recursive_repr_indirection_two"), # recursion error
- ("TestCase", "test_0_field_compare"), # should return False
- ("TestCase", "test_1_field_compare"), # order=False is apparently ignored
- ("TestOrdering", "test_no_order"), # probably order=False being ignored
- ("TestRepr", "test_no_repr"), # turning off repr doesn't work
(
"TestCase",
"test_intermediate_non_dataclass",
), # issue with propagating through intermediate class
- ("TestCase", "test_post_init"), # init=False being ignored
(
"TestFrozen",
), # raises AttributeError, not FrozenInstanceError (may be hard to fix)
+ ('TestCase', 'test_post_init'), # Works except for AttributeError instead of FrozenInstanceError
("TestReplace", "test_frozen"), # AttributeError not FrozenInstanceError
(
"TestCase",
@@ -158,7 +160,6 @@ skip_tests = frozenset(
), # doesn't define __setattr__ and just relies on Cython to enforce readonly properties
("TestCase", "test_compare_subclasses"), # wrong comparison
("TestCase", "test_simple_compare"), # wrong comparison
- ("TestEq", "test_no_eq"), # wrong comparison (probably eq=False being ignored)
(
"TestCase",
"test_field_named_self",
@@ -210,7 +211,6 @@ version_specific_skips = {
), # needs language support for | operator on types
}
-
class DataclassInDecorators(ast.NodeVisitor):
found = False