I've updated the dataclasses in the test suite to use default_factory, and I've added a file tests/structured_conf/dataclasses_pre_311.py that contains old-style dataclasses that do not use default_factory for mutable dataclass defaults. This pre_311 file is run only when python version < 3.10.
Commits:
tests/structured_config module fixture: use pytest.param
test dataclass with mutable default: skip if python>=3.11
tests/structured_conf: default_factory for mutable dataclass args
This PR updates OmegaConf's tests and metadata for compatibility with python3.11.
There are no changes to the omegaconf source code.
The changes to the test are motivated by python3.11 dataclasses dropping support for mutable default arguments. This means dataclasses with mutable default arguments must use
default_factory
.I've updated the dataclasses in the test suite to use
default_factory
, and I've added a filetests/structured_conf/dataclasses_pre_311.py
that contains old-style dataclasses that do not usedefault_factory
for mutable dataclass defaults. This pre_311 file is run only when python version < 3.10.Commits: