Skip to content

Commit

Permalink
Update pytest_odoo.py
Browse files Browse the repository at this point in the history
Co-authored-by: Yannick Payot <yannick.payot@camptocamp.com>
  • Loading branch information
lmignon and yvaucher authored Oct 7, 2024
1 parent 9ee223f commit 320b456
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pytest_odoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ def _worker_db_name():
try:
if xdist_worker:
db_name = f"{original_db_name}-{xdist_worker}"
ret = os.system(f"psql -lqt | cut -d \| -f 1 | grep -w {db_name}")
if ret == 0:
os.system(f"dropdb {db_name}")
os.system(f"dropdb {db_name} --if-exists")
os.system(f"createdb -T {original_db_name} {db_name}")
odoo.tools.config["db_name"] = db_name
yield db_name
Expand Down

0 comments on commit 320b456

Please sign in to comment.