Skip to content

Commit f93364b

Browse files
committed
refactor: add regex match for KeyError message in test
1 parent c8bc837 commit f93364b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_source_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,5 @@ def settings_customise_sources(
226226
) -> tuple[PydanticBaseSettingsSource, ...]:
227227
return (YamlConfigSettingsSource(settings_cls),)
228228

229-
with pytest.raises(KeyError):
229+
with pytest.raises(KeyError, match=r'yaml_config_section key ".*" not found in .+'):
230230
Settings()

0 commit comments

Comments
 (0)