Skip to content

Commit 2592ae2

Browse files
committed
unnecessary arg check
1 parent acd7721 commit 2592ae2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

msrc-appconfig/msrc/appconfig/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ def gather_config(
140140
141141
Returns the collected configuration."""
142142

143-
if not inspect.isclass(config_type):
144-
raise TypeError("First argument must be a class.")
145143
if env_var_prefix is None and _main_script.name:
146144
env_var_prefix = _main_script.name.upper() + '_'
147145
try:

msrc-appconfig/tests/gather_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ def test_arg_overrides_env(tmp_path, mocker):
142142
# ==========
143143

144144

145+
def test_gather_invalid_schema():
146+
"First parameter must be a class."
147+
with pytest.raises(TypeError):
148+
msrc.appconfig.read_all.gather(WithDefaults()) # type: ignore
149+
with pytest.raises(ValueError):
150+
msrc.appconfig.read_all.gather(dict)
151+
152+
145153
def test_gather_invalid_defaults():
146154
"Data in `override_defailts` must be parseable."
147155
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)