From 5d786006e563ab691af8bd68c043343a2ba0366f Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Fri, 17 Nov 2023 11:58:59 +0000 Subject: [PATCH] tests/u, tests/i: set TZ variable before running tests * We were using the pytest-env plugin to run the tests in a non-UTC time zone. * The pytest-env plugin doesn't work with pytest-xdist so this was being ignored. * Also due to the way TZ support works in Python, changing the env var whilst Python is running may or may not result in changes. --- .github/workflows/test_fast.yml | 4 ++++ pytest.ini | 5 +---- setup.cfg | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml index 2f303e36ee7..86a3aa503e9 100644 --- a/.github/workflows/test_fast.yml +++ b/.github/workflows/test_fast.yml @@ -24,8 +24,12 @@ jobs: include: - os: 'macos-latest' python-version: '3.7' + env: + # Use non-UTC time zone + TZ: XXX-09:35 PYTEST_ADDOPTS: --cov --cov-append -n 5 --color=yes + steps: - name: Checkout uses: actions/checkout@v4 diff --git a/pytest.ini b/pytest.ini index 81df3785cec..9be86cb507c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -32,13 +32,10 @@ testpaths = cylc/flow/ tests/unit/ tests/integration/ -env = - # a weird timezone to check that tests aren't assuming the local timezone - TZ=XXX-09:35 doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS asyncio_mode = auto markers= - linkcheck: Test links \ No newline at end of file + linkcheck: Test links diff --git a/setup.cfg b/setup.cfg index e8e7f46b2d2..aba1675de3f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -121,7 +121,6 @@ tests = pytest-asyncio>=0.17,!=0.22.0 pytest-cov>=2.8.0 pytest-xdist>=2 - pytest-env>=0.6.2 pytest>=6 testfixtures>=6.11.0 towncrier>=23