Example for using pyproject.toml for setting env vars
See original GitHub issueThanks for creating and maintaining this package!
Can you please provide an example of using this library with pyproject.toml files that pytest config supports? Neither of the below work.
1:
[tool.pytest.ini_options]
env =[
"HOME=~/tmp",
"RUN_ENV=test"
]
2:
[tool.pytest.ini_options]
env ="HOME=~/tmp\nRUN_ENV=test"
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Add support for environment variables at pyproject.toml #208
The use case I have is that I need to use different repository urls depending on my environment. Something like: [[tool.poetry.source]] name =...
Read more >envtoml - PyPI
A simple way of using environment variables in TOML configs (via interpolation)
Read more >Configuration | Documentation | Poetry - Python dependency ...
Poetry supports this and any setting can be set by using environment variables. The environment variables must be prefixed by POETRY_ and are...
Read more >How to insert test-time environment variable with pytest ...
The correct format is: env = [ "DATA_DIR = data/test_assets", "ROSETTA = rosetta/main" ].
Read more >config - pypyr
Configure pypyr task-runner run-time settings & defaults with pyproject.toml or the yaml config file.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @nermand and @bosatsu! Good pointers. I can confirm that any of the below work without
python-dotenvorpytest-dotenv: 1.If it doesn’t recommend rechecking the pytest version. My
pytestversion was downgraded to <6.0, without me noticing, and sincepyproject.tomlsupport was added in 6.0+, it wasn’t working.@setu4993
The following works for me, and I’m not using
python-dotenv: