Skip to content

Commit 0168a0e

Browse files
lmignonyvaucher
andcommitted
Drop DB in one subprocess call
Co-authored-by: Yannick Payot <yannick.payot@camptocamp.com>
1 parent 9ee223f commit 0168a0e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pytest_odoo.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ def _worker_db_name():
122122
try:
123123
if xdist_worker:
124124
db_name = f"{original_db_name}-{xdist_worker}"
125-
ret = os.system(f"psql -lqt | cut -d \| -f 1 | grep -w {db_name}")
126-
if ret == 0:
127-
os.system(f"dropdb {db_name}")
125+
os.system(f"dropdb {db_name} --if-exists")
128126
os.system(f"createdb -T {original_db_name} {db_name}")
129127
odoo.tools.config["db_name"] = db_name
130128
yield db_name

0 commit comments

Comments
 (0)