def test_try_to_load_from_py_module_name(tmpdir): settings = DynaconfDict() dummy_folder = tmpdir.mkdir("dummy") dummy_folder.join("dummy_module.py").write('FOO = "bar"') dummy_folder.join("__init__.py").write('print("initing dummy...")') try_to_load_from_py_module_name(settings, "dummy.dummy_module") assert settings.exists("FOO")
def test_silently_try_to_load_from_py_module_name(tmpdir): settings = DynaconfDict() try_to_load_from_py_module_name(settings, "foo.bar.dummy", silent=True) assert settings.exists("FOO") is False