Added more tests and moved all env and env file testing to classes (it might make more sense to just move them to separate files?).
This commit is contained in:
@ -78,21 +78,17 @@ def read(filename, module, install=False, quiet=False, verbose=False, default_en
|
||||
raise RuntimeError('UNEXPECTED: argparse should not allow this.')
|
||||
|
||||
env_dir = Path(filename).parent or Path(module).parent
|
||||
|
||||
if default_env_file:
|
||||
for f in default_env_file:
|
||||
env_file_path = env_dir.joinpath(f)
|
||||
load_dotenv(env_file_path)
|
||||
|
||||
if default_env:
|
||||
for e in default_env:
|
||||
set_env_var(e)
|
||||
|
||||
if env_file:
|
||||
for f in env_file:
|
||||
env_file_path = env_dir.joinpath(f)
|
||||
load_dotenv(env_file_path, override=True)
|
||||
|
||||
if env:
|
||||
for e in env:
|
||||
set_env_var(e, override=True)
|
||||
|
||||
Reference in New Issue
Block a user