Skip to content

Commit e6e015c

Browse files
Check that load_config raises ValidationError if config is None
Signed-off-by: Elzbieta Kotulska <[email protected]>
1 parent cd93587 commit e6e015c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/config/test_util.py

Lines changed: 7 additions & 0 deletions
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)