You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for reference I'm using
pytest: 8.3.3
pytest-odoo: 2.1.1
I have encountered a problem with pytest-odoo using the same environment variables for database connection configuration as the Odoo container (HOST, PORT, USER, PASSWORD)
The USER environment variable is often set to the current username on POSIX systems and this causes a bit of an issue when running pytest-odoo in such an environent. Even when a odoo.conf with the database user exists pytest-odoo passes the --db_user argument to Odoo which seems to override the values in the odoo.conf.
In my opinion this is rather annoying behavior in general and in combination with an IDE where in some cases environment variables may be annoying or hard to control is quite bad.
Generally it doesn't seem like a great idea to use environment variables like USER for anything like this, and they should be prefixed with something, for example ODOO_.
Can we either
add a prefix to said environment variables, say ODOO_ (although this would likely break their original intended purpose as they won't "just work" in the Odoo container anymore)
allow this feature to be turned either on or off with a flag, possibly defaulting to on as that would not result in any breaking changes
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hello,
for reference I'm using
pytest: 8.3.3
pytest-odoo: 2.1.1
I have encountered a problem with pytest-odoo using the same environment variables for database connection configuration as the Odoo container (HOST, PORT, USER, PASSWORD)
see code:
pytest-odoo/pytest_odoo.py
Lines 80 to 82 in f602202
The
USER
environment variable is often set to the current username on POSIX systems and this causes a bit of an issue when running pytest-odoo in such an environent. Even when aodoo.conf
with the database user exists pytest-odoo passes the--db_user
argument to Odoo which seems to override the values in theodoo.conf
.In my opinion this is rather annoying behavior in general and in combination with an IDE where in some cases environment variables may be annoying or hard to control is quite bad.
Generally it doesn't seem like a great idea to use environment variables like
USER
for anything like this, and they should be prefixed with something, for exampleODOO_
.Can we either
ODOO_
(although this would likely break their original intended purpose as they won't "just work" in the Odoo container anymore)Thanks in advance!
The text was updated successfully, but these errors were encountered: