You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--envfile "" loads the configured env files instead of failing #320
Passing an empty value to --envfile, as pytest --envfile "$CI_ENV_FILE" does when the variable is unset, behaves like not passing the option. pytest loads the env_files from the configuration and can exit 0, where the README says a CLI file that does not exist raises FileNotFoundError.
Affected code
plugin.py#L167-L174: _load_env_files reads the option and checks that the file exists.
Mechanism
_load_env_filestests the option's truthiness. The option defaults to None, and --envfile "" stores an empty string, which is falsy too. The function then yields the configured files and returns before the existence check. --envfile + takes the other branch and raises, because the name after the + is checked.
Activity