Replies: 1 comment 5 replies
-
|
pytest will NOT substutute env vars in the configfile whatever uses the variables will have to do that on its own so i recommend 2. as for passing credentials "propperly" to pytest, im currently not aware of a plugin that resolves it |
Beta Was this translation helpful? Give feedback.
5 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.
-
Is there a way to read environment variables in
pytest.ini?pytest-envdoes the opposite and lets you set environment variables in there but my issue is different.pytest-mongodbrequires these three variables to be set inpytest.iniHowever, I would like pytest.ini to read my environement variables instead.
Now obviously this isn't supported out the box.
Options:
pytestconfig.inicfgbutpytestconfigis a fixture and fixtures can't be used in hooks AFAIK. So it won't execute beforepytest-mongodbbegins - which will cause issues.pytest-mongodbwhich solves the issue for this repo but not for all the others using this annoying design.passenv) but this isn't how vscode operates with tests so it will be problematic and I won't be able just to use pytest raw on the CLIBeta Was this translation helpful? Give feedback.
All reactions