quiqua / pytest-dotenv

A py.test plugin that parses environment files before running tests
MIT License
189 stars 18 forks source link

Add ability to pass as argument #12

Closed Amertz08 closed 4 years ago

Amertz08 commented 4 years ago

It would be nice to be able to pass --env-file or something similar as a CLI option. I switch stuff like databases off .env files and would like to avoid maintaining a 1-to-1 of pytest.ini files and .env files. Avoids pytest-dev.ini -> dev.env, pytest-qa.ini -> qa.env and pytest-prod.ini -> prod.env.

quiqua commented 4 years ago

I'll have a look into this in the next weeks.

If you want to open a PR yourself, take a look at the pep8 plugin to add a command line option.

quiqua commented 4 years ago

This has been fixed with #15

Amertz08 commented 4 years ago

Thanks for doing this. I am already using it to test my app locally against local infrastructure as well as dev infra. One thought might be some type of warning or even failure if the file cannot be found.

quiqua commented 4 years ago

One thought might be some type of warning or even failure if the file cannot be found.

Feel free to open up a PR with the required changes :)