pytest-dotenv
pytest-dotenv copied to clipboard
env_override_existing_values doesn't work if --envfile option is set
"override" is hardcoded by True. Suggest to add _override = early_config.getini("env_override_existing_values") to make this configurable
def pytest_sessionstart(session):
config = session.config
if config.getoption("envfile", default=None) is not None:
load_dotenv(dotenv_path=config.getoption("envfile"), override=True)
That is currently intentional as the description of this option points out: https://github.com/quiqua/pytest-dotenv/blob/866c90d9475bc469a0e9fc848868af0139658786/pytest_dotenv/plugin.py#L17-L21
Feel free to open a PR and adjust the behaviour accordingly though.
@quiqua pls check https://github.com/quiqua/pytest-dotenv/pull/21/files