tests: return default database name if not running within tox (#68059)

This commit is contained in:
Frédéric Péters 2022-08-09 14:22:45 +02:00
parent 48f1e920bc
commit 6ded861e97
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,8 @@ def get_safe_db_name():
pytest django append the tox env name automatically
through a fixture so we have to skip this step.
"""
if not os.environ.get('TOX_ENV_NAME'):
return 'hobo-test'
BRANCH_NAME = os.environ.get('BRANCH_NAME', '').replace('/', '-')[:15]
parts = [BRANCH_NAME]
if not os.environ.get("TOX_PARALLEL_ENV"):