Skip to content

Commit be46a11

Browse files
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.
1 parent ae25de0 commit be46a11

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/test_fast.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ jobs:
2424
include:
2525
- os: 'macos-latest'
2626
python-version: '3.7'
27+
2728
env:
29+
# Use non-UTC time zone
30+
TZ: XXX-09:35
2831
PYTEST_ADDOPTS: --cov --cov-append -n 5 --color=yes
32+
2933
steps:
3034
- name: Checkout
3135
uses: actions/checkout@v4

pytest.ini

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,10 @@ testpaths =
3232
cylc/flow/
3333
tests/unit/
3434
tests/integration/
35-
env =
36-
# a weird timezone to check that tests aren't assuming the local timezone
37-
TZ=XXX-09:35
3835
doctest_optionflags =
3936
NORMALIZE_WHITESPACE
4037
IGNORE_EXCEPTION_DETAIL
4138
ELLIPSIS
4239
asyncio_mode = auto
4340
markers=
44-
linkcheck: Test links
41+
linkcheck: Test links

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ tests =
121121
pytest-asyncio>=0.17,!=0.23.*
122122
pytest-cov>=2.8.0
123123
pytest-xdist>=2
124-
pytest-env>=0.6.2
125124
pytest>=6
126125
testfixtures>=6.11.0
127126
towncrier>=23

0 commit comments

Comments
 (0)