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 Nov 15, 2023
1 parent 2eb5800 commit 1491248
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 1491248

Please sign in to comment.