Skip to content

Commit e6d67ca

Browse files
authored
Ensure Python clock timezone is reset during test teardown (#13537)
1 parent 059ee9c commit e6d67ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_builders/test_build_linkcheck.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,12 @@ def test_too_many_requests_retry_after_HTTP_date(tz, app, monkeypatch, capsys):
11271127
) as address:
11281128
app.build()
11291129

1130+
# Undo side-effects: the monkeypatch context manager clears the TZ environment
1131+
# variable, but we also need to reset Python's internal notion of the current
1132+
# timezone.
1133+
if sys.platform != 'win32':
1134+
time.tzset()
1135+
11301136
content = (app.outdir / 'output.json').read_text(encoding='utf8')
11311137
assert json.loads(content) == {
11321138
'filename': 'index.rst',

0 commit comments

Comments
 (0)