Skip to content

Commit

Permalink
USE_PYTZ as env var in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mfogel committed Jul 15, 2023
1 parent 069c302 commit 4ca521b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11"]
django-version: ["3.2", "4.1", "4.2"]
db-engine: [sqlite, postgres]
use-pytz: [True, False]
exclude:
- django-version: "3.2"
python-version: "3.11"
- django-version: "3.2"
use-pytz: False

env:
PYTHON_VERSION: ${{ matrix.python-version }}
DJANGO_VERSION: ${{ matrix.django-version }}
DB_ENGINE: ${{ matrix.db-engine }}
USE_PYTZ: ${{ matrix.use-pytz }}

services:
postgres:
Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest
import pytz
from django import forms
Expand Down Expand Up @@ -93,7 +95,7 @@ class Meta:
fields = "__all__"


@pytest.fixture(params=[True, False])
@pytest.fixture(params=[bool(os.environ["USE_PYTZ"])] if "USE_PYTZ" in os.environ else [True, False])
def use_pytz(request):
yield request.param

Expand Down

0 comments on commit 4ca521b

Please sign in to comment.