Skip to content

Commit 0af290d

Browse files
committed
no need to modify it if it already equals that
1 parent a5b8acb commit 0af290d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pytest_django/fixtures.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,11 @@ def _set_suffix_to_test_databases(suffix):
180180

181181
if test_name == ":memory:":
182182
continue
183+
if test_name.endswith("_{}".format(suffix)):
184+
continue
183185

184186
db_settings.setdefault("TEST", {})
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
187+
db_settings["TEST"]["NAME"] = "{}_{}".format(test_name, suffix)
189188

190189

191190
# ############### User visible fixtures ################

0 commit comments

Comments
 (0)