add stderr message if env file not found#17
Conversation
|
|
||
| def _check_exists(filename): | ||
| if not os.path.exists(filename): | ||
| sys.stderr.write("Env file not found: %s\n" % filename) |
There was a problem hiding this comment.
We might need a sys.stderr.flush() here. I'm not entirely sure.
| load_dotenv(dotenv_path=env_file, override=True) | ||
|
|
||
|
|
||
| def _check_exists(filename): |
There was a problem hiding this comment.
Shall the plugin just print warnings to the user or completely stop the execution if something is not configured correctly?
There was a problem hiding this comment.
Also do you know who other py.test plugins behave in such a scenario?
There was a problem hiding this comment.
I do not know of any other plugins that have a similar scenario. I'll try and look some up.
The way I implemented it continues execution but prints to stderr (which should highlight for certain terminals). load_dotenv does nothing if it cannot find the file. So it is currently silently failing. The warning should make it more obvious.
This PR should add a simple
stderrmessage if the env file is not actually found.