Skip to content

Commit d615270

Browse files
authored
Fix env-var name for parallel tox tests
When running tests in parallel, we need to add a suffix to Django DB names to avoid clashes. This previously used `TOX_PARALLEL_ENV`, but Tox no longer sets this environment variable. Tox does set an environment variable called `TOX_ENV_NAME`, which works for this purpose, so use that instead.
1 parent 11f613d commit d615270

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_django/fixtures.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
def django_db_modify_db_settings_tox_suffix() -> None:
6767
skip_if_no_django()
6868

69-
tox_environment = os.getenv("TOX_PARALLEL_ENV")
69+
tox_environment = os.getenv("TOX_ENV_NAME")
7070
if tox_environment:
7171
# Put a suffix like _py27-django21 on tox workers
7272
_set_suffix_to_test_databases(suffix=tox_environment)

0 commit comments

Comments
 (0)