Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env_override_existing_values doesn't work if --envfile option is set #20

Open
Krops opened this issue Nov 11, 2020 · 2 comments
Open

env_override_existing_values doesn't work if --envfile option is set #20

Krops opened this issue Nov 11, 2020 · 2 comments

Comments

@Krops
Copy link

Krops commented Nov 11, 2020

"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)
@Krops Krops changed the title env_override_existing_values doesn't work if --envfile option is setted env_override_existing_values doesn't work if --envfile option is set Nov 11, 2020
@quiqua
Copy link
Owner

quiqua commented Nov 11, 2020

That is currently intentional as the description of this option points out:

parser.addoption("--envfile",
dest="envfile",
default="foo",
type=str,
help="Overwrite any environment variable specified in this file. This argument ignores the .ini settings.")

Feel free to open a PR and adjust the behaviour accordingly though.

@Krops
Copy link
Author

Krops commented Nov 11, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants