Skip to content

Commit

Permalink
Fix matter_yamltests with Python 11. (#25539)
Browse files Browse the repository at this point in the history
Due to https://docs.python.org/3.11/whatsnew/3.11.html#dataclasses, the previous
code fails: it's using mutable class instances as default values of dataclass
fields.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Aug 16, 2023
1 parent 487eac6 commit 1640708
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ class TestParserBuilderConfig:
current parsing state.
"""
tests: list[str] = field(default_factory=list)
parser_config: TestParserConfig = TestParserConfig()
parser_config: TestParserConfig = field(default_factory=TestParserConfig)
hooks: TestParserHooks = TestParserHooks()
options: TestParserBuilderOptions = TestParserBuilderOptions()
options: TestParserBuilderOptions = field(
default_factory=TestParserBuilderOptions)


class TestParserBuilder:
Expand Down

0 comments on commit 1640708

Please sign in to comment.