Skip to content

Commit

Permalink
Fix env-var name for parallel tox tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
meshy authored Feb 9, 2024
1 parent 11f613d commit d615270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytest_django/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
def django_db_modify_db_settings_tox_suffix() -> None:
skip_if_no_django()

tox_environment = os.getenv("TOX_PARALLEL_ENV")
tox_environment = os.getenv("TOX_ENV_NAME")
if tox_environment:
# Put a suffix like _py27-django21 on tox workers
_set_suffix_to_test_databases(suffix=tox_environment)
Expand Down

0 comments on commit d615270

Please sign in to comment.