Empty environment variable DB_NAME treated as set
Typical behaviour in the shell is to treat existing environment variables containing nothing the same as a if the env variable is not defined.
test_tryton.py
does not behave like this:
$ env -u DB_NAME -u TRYTOND_CONFIG -u TRYTOND_DATABASE_URI python -m unittest discover -vvvvv -s modules/party/tests/
…
Ran 51 tests in 16.400s
OK
$ DB_NAME= env -u TRYTOND_CONFIG -u TRYTOND_DATABASE_URI python -m unittest discover -vvvvv -s modules/party/tests/
…
File "…/trytond/trytond/pool.py", line 190, in get
return self._pool[self.database_name][type][name]
KeyError: ':memory:'
…
trytond-6.8.0
Expected behaviour: both commands work the same way
This is caused by https://foss.heptapod.net/tryton/tryton/-/blob/trytond-6.8.2/trytond/trytond/tests/test_tryton.py#L58
Edited by Hartmut Goebel