Skip to content

Commit 66072e0

Browse files
committed
Update the note about python versions under which dataclass slots are supported
1 parent c92e7da commit 66072e0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/serializers/test_any.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class Foo2(Foo):
493493
assert any_serializer.to_python(foo2) == IsStrictDict(a=2, b='b')
494494

495495

496-
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10')
496+
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')
497497
def test_dataclass_slots(any_serializer):
498498
@dataclasses.dataclass(slots=True)
499499
class Foo:
@@ -511,7 +511,7 @@ class Foo2(Foo):
511511
assert any_serializer.to_python(foo2) == IsStrictDict(a=2, b='b')
512512

513513

514-
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10')
514+
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')
515515
def test_dataclass_slots_init_vars(any_serializer):
516516
@dataclasses.dataclass(slots=True)
517517
class Foo:

tests/validators/test_dataclasses.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def test_custom_dataclass_names():
11931193
]
11941194

11951195

1196-
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10')
1196+
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')
11971197
def test_slots() -> None:
11981198
@dataclasses.dataclass(slots=True)
11991199
class Model:
@@ -1223,7 +1223,7 @@ class Model:
12231223
val.validate_assignment(m, 'x', 'abc')
12241224

12251225

1226-
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10')
1226+
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')
12271227
def test_dataclass_slots_field_before_validator():
12281228
@dataclasses.dataclass(slots=True)
12291229
class Foo:
@@ -1257,7 +1257,7 @@ def validate_b(cls, v: bytes, info: core_schema.FieldValidationInfo) -> bytes:
12571257
assert dataclasses.asdict(foo) == {'a': 1, 'b': 'hello world!'}
12581258

12591259

1260-
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10')
1260+
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')
12611261
def test_dataclass_slots_field_after_validator():
12621262
@dataclasses.dataclass(slots=True)
12631263
class Foo:
@@ -1356,7 +1356,7 @@ class DuplicateDifferentSlots:
13561356
),
13571357
],
13581358
)
1359-
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10')
1359+
@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')
13601360
def test_slots_dataclass_subclass(revalidate_instances, input_value, expected):
13611361
schema = core_schema.dataclass_schema(
13621362
FooDataclassSlots,

0 commit comments

Comments
 (0)