Replies: 2 comments 3 replies
-
Pytest itself is unaware of dotenv files No built-in support planned |
Beta Was this translation helpful? Give feedback.
0 replies
-
@pawan-qa the code you shown should be working, do you get any errors? Make sure |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to load, say
qa.env
file forqa
env anddev.env
file fordev
env. How do I tell pytest to parse env name from cli arg and load specific.env
file ?How do I dynamically pass
env
value tofind_dotenv
method-load_dotenv(find_dotenv(f'{env}.env'))
My cli arg looks like
pytest -sv <test-folder-path> --env qa
conftest.py
I also tried with this fixture in conftest.py file -
I am open to any solution which loads specific .env file dynamically.
Beta Was this translation helpful? Give feedback.
All reactions