Skip to content

Commit 8be7989

Browse files
committed
should only add suffix if it wasn't already added
1 parent 870112d commit 8be7989

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytest_django/fixtures.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ def _set_suffix_to_test_databases(suffix):
182182
continue
183183

184184
db_settings.setdefault("TEST", {})
185-
db_settings["TEST"]["NAME"] = "{}_{}".format(test_name, suffix)
185+
test_db_name = test_name
186+
if not test_name.endswith("_{}".format(suffix)):
187+
test_db_name = "{}_{}".format(test_name, suffix)
188+
db_settings["TEST"]["NAME"] = test_db_name
186189

187190

188191
# ############### User visible fixtures ################

0 commit comments

Comments
 (0)