Skip to content

Commit

Permalink
#116: Fix typing in assert_field_no_default() for Python < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryDiv committed Apr 30, 2024
1 parent 5f9864c commit f8ab400
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/dataclasses/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def assert_field_no_default(field: T_DataclassField) -> None:

# For Python under 3.10, check that an exception raising default_factory is set
if sys.version_info < (3, 10):
assert field.default_factory is not dataclasses.MISSING
with pytest.raises(TypeError, match="required keyword-only argument"):
field.default_factory()
else:
Expand Down

0 comments on commit f8ab400

Please sign in to comment.