From 4ca521b22f08c53480a7b7be6fc691f6a946bc9f Mon Sep 17 00:00:00 2001 From: Mike Fogel Date: Sat, 15 Jul 2023 15:43:55 -0700 Subject: [PATCH] USE_PYTZ as env var in tests --- .github/workflows/ci.yml | 4 ++++ tests/conftest.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 844f525..0e65c5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/tests/conftest.py b/tests/conftest.py index af500a2..e75079e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +import os + import pytest import pytz from django import forms @@ -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