Skip to content

Commit b0ba1f4

Browse files
authored
MpConfig edit throws error with invalid file path. (#395)
1 parent 252dd18 commit b0ba1f4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

msticpy/config/mp_config_edit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def __init__(
7979
self.mp_conf_file.current_file = conf_filepath
8080
elif isinstance(settings, str):
8181
self.mp_conf_file = MpConfigFile(file=settings)
82-
self.mp_conf_file.load_from_file(file=settings)
8382
else:
8483
self.mp_conf_file = MpConfigFile()
8584
self.mp_conf_file.load_default()

tests/config/test_mp_config_edit.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,10 @@ def test_mp_edit_load_params():
140140
for key in orig_settings.keys():
141141
check.equal(orig_settings[key], mp_conf.mp_controls.mp_config[key])
142142

143-
# Test no existing MPConfig
143+
# Test invalid file in MPConfig env and with file parameter.
144+
# should load without exception
144145
with custom_mp_config(str(config_path)):
145146
os.environ["MSTICPYCONFIG"] = "./invalid_file.yaml"
146-
with pytest.raises(ValueError):
147-
with pytest.warns(UserWarning):
148-
mp_conf = MpConfigEdit()
147+
mp_conf = MpConfigEdit()
148+
149+
mp_conf = MpConfigEdit(settings="./invalid_file.yaml")

0 commit comments

Comments
 (0)