-
Notifications
You must be signed in to change notification settings - Fork 51
add flag to disable environment variables #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
petrus-v
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm not using this feature as well and could effectively create unexpected behaviour if those env names are set which are very common name...
I would love to see PYTEST-ODOO-DB- prefix but this would breaks existing workflow. I believes your solution seems fine.
Maybe we could add a deprecation warning in the same time that suggest to move to the new environ names (with suggest prefix) in the current version and prepare next major release that remove support for those env names
@simahawk what's your call on this ?
I would suggest as an alternative, to nullify environment variable in the line which executes pytest. $ USER= pytest -s --odoo-database=test --odoo-log-level=debug_sql |
Consider that it's not always easily possible to do that, especially with IDEs! Also according to POSIX...
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html |
|
just to let you know this issue just caught me, indeed my USER env var was set. not sure if this PR is a best option but I think the issue will block many people. Eventually we could have a try/except telling it took user from USER in case of database connection failure and suggest to set USER or use this new --odoo-disable-docker-env option. |
|
I stumbled upon this exact issue, anything I could contribute to help you all getting this merged? |
I added a flag
--odoo-disable-docker-envthat allows disabling theHOSTPORTUSERandPASSWORDenvironment variables added in #57 as they may conflict with environment variables in some development setups (mainlyUSERis extremely common to be set)If there are any improvements needed for this to get merged, please do tell - I'd love to see this issue fixed as currently it makes pytest-odoo unusable without patches for me with my setup...
closes: #81