Skip to content

Commit 47adc26

Browse files
Check that load_config raises ValidationError if config is None (#1102)
2 parents cd93587 + e6e015c commit 47adc26

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/config/test_util.py

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ def test_load_config_marshmallow_dataclass() -> None:
5353
_ = load_config(MmSimpleConfig, config)
5454

5555

56+
def test_load_config_load_None() -> None:
57+
"""Test that load_config raises ValidationError if the configuration is None."""
58+
config: dict[str, Any] = {}
59+
with pytest.raises(marshmallow.ValidationError):
60+
_ = load_config(MmSimpleConfig, config.get("loggers", None))
61+
62+
5663
def test_load_config_type_hints(mocker: MockerFixture) -> None:
5764
"""Test that load_config loads a configuration into a configuration class."""
5865
mock_class_schema = mocker.Mock()

0 commit comments

Comments
 (0)