From 6ded861e97f1135779d6a9c4ac786f808a98ecd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 9 Aug 2022 14:22:45 +0200 Subject: [PATCH] tests: return default database name if not running within tox (#68059) --- hobo/test_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hobo/test_utils.py b/hobo/test_utils.py index ff25d32..138898c 100644 --- a/hobo/test_utils.py +++ b/hobo/test_utils.py @@ -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"):