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

Fix issue if overide option is disabled envfile option overides witho… #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Krops
Copy link

@Krops Krops commented Nov 11, 2020

…ut checking

@Krops
Copy link
Author

Krops commented Nov 11, 2020

@quiqua

@quiqua
Copy link
Owner

quiqua commented Apr 4, 2021

Hej! Sorry for the late response.

I've some questions for the integration of this PR.

Currently the flow of the plugin is:

  1. You can specify some env files that are loaded when the tests are started via the pytest configuration file(s)
    Those options include to specify if existing values should be overridden.
  2. Additionally you can pass the runtime parameter --env-file to your tests, that will explicitly use all the values defined in that file.

What is the benefit of using the enable or disable that existing values will be overridden, when the runtime parameter is set?

Lets say I have the following setup:

  • pytest.ini

    [pytest]
    env_files =
        .default-test-values
    
  • .default-test-values

    FOO=bar
    SPAM=egg
    

Now if I want to use additionally a env file passed via the CLI --env-file=.override-values, then I could just specify the values that I want to replace:

SPAM=baz

This will result in the following env variables when the tests are executed:

FOO=bar
SPAM=baz

Could you elaborate, why it might be useful to not overwrite the values?

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

Successfully merging this pull request may close these issues.

2 participants