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 8, 2023
1 parent 76e9c0e commit 1318229
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 1318229

Please sign in to comment.