pytest-dotenv
pytest-dotenv copied to clipboard
A py.test plugin that parses environment files before running tests
Hi, I would like to load different files from different `conftest` files, is this possible? Thanks!
If `pytest` is used pytest-dotenv will only load an environment file from the `pytest.ini`. If `py.test` is used then the cli arg `--envfile` will be used. `pytest --envfile ` does...
Fix confusing typo, replacing the incorrect `python-dotenv` with the correct `pytest-dotenv`.
Hello pytest-dotenv is very interesting for loading dotenv for integration tests (ie test that depends on the environment), for example to simulate the test environments in CI. But this approach...
For Django projects using django-dotenv and calling `dotenv.read_dotenv()` from manage.py, installing this library will break manage.py due to a namespace conflict between django-dotenv and python-dotenv (a dependency that this library...
When using pytest to test utilities (CLI) or a mix of API and utility which require setting `PYTHONPATH`, the current set of affairs is not great: - because `pytest_dotenv` updates...
Hey there! I'm using this plugin and I've noticed the following behavior, which is somewhat confusing. If I have my pytest-dotenv config as follows: ```[tool:pytest] env_files = .env
"override" is hardcoded by True. Suggest to add _override = early_config.getini("env_override_existing_values") to make this configurable ``` def pytest_sessionstart(session): config = session.config if config.getoption("envfile", default=None) is not None: load_dotenv(dotenv_path=config.getoption("envfile"), override=True) ```
This PR should add a simple `stderr` message if the env file is not actually found.