From 72281b0c632c1d7c09a066227c2c98cbb3f31eb0 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 22 Jun 2023 14:37:49 +0200 Subject: [PATCH] [IMP] runbot_merge: allow running test suite without an explicit addons path --- conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conftest.py b/conftest.py index 8e7b05f9..0af3c1c5 100644 --- a/conftest.py +++ b/conftest.py @@ -277,7 +277,7 @@ class DbDict(dict): with tempfile.TemporaryDirectory() as d: subprocess.run([ 'odoo', '--no-http', - '--addons-path', self._adpath, + *(['--addons-path', self._adpath] if self._adpath else []), '-d', db, '-i', module + ',auth_oauth', '--max-cron-threads', '0', '--stop-after-init', @@ -296,7 +296,7 @@ def dbcache(request): dbs = DbDict(request.config.getoption('--addons-path')) yield dbs for db in dbs.values(): - subprocess.run(['dropdb', db], check=True) + subprocess.run(['dropdb', '--if-exists', db], check=True) @pytest.fixture def db(request, module, dbcache): @@ -369,10 +369,10 @@ def server(request, db, port, module, dummy_addons_path, tmpdir): if not request.config.getoption('--log-github'): log_handlers.append('github_requests:WARNING') - addons_path = ','.join(map(str, [ + addons_path = ','.join(map(str, filter(None, [ request.config.getoption('--addons-path'), dummy_addons_path, - ])) + ]))) cov = [] if request.config.getoption('--coverage'):