Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Comments

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

Open
Krops wants to merge 4 commits intoquiqua:masterfrom
Krops:fix_override_envfile_issue
Open

Fix issue if overide option is disabled envfile option overides witho…#21
Krops wants to merge 4 commits intoquiqua:masterfrom
Krops:fix_override_envfile_issue

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants