OP-3426 - fix - add _tests suffix only if not present

_tests suffix is added to avalon and openpype DB for testing run. env vars for these might be already injected, so do not add them again.
This commit is contained in:
Petr Kalis 2022-11-07 12:50:05 +01:00
parent 418135cde0
commit d3769b3b73

View file

@ -1030,9 +1030,11 @@ def boot():
if os.environ.get("IS_TEST") == "1":
# change source DBs to predefined ones set for automatic testing
os.environ["OPENPYPE_DATABASE_NAME"] += "_tests"
if "_tests" not in os.environ["OPENPYPE_DATABASE_NAME"]:
os.environ["OPENPYPE_DATABASE_NAME"] += "_tests"
avalon_db = os.environ.get("AVALON_DB") or "avalon"
os.environ["AVALON_DB"] = avalon_db + "_tests"
if "_tests" not in avalon_db:
os.environ["AVALON_DB"] = avalon_db + "_tests"
global_settings = get_openpype_global_settings(openpype_mongo)