diff --git a/tests/test_builders/test_build_linkcheck.py b/tests/test_builders/test_build_linkcheck.py index bdd8dea54c1..b0c74856b4e 100644 --- a/tests/test_builders/test_build_linkcheck.py +++ b/tests/test_builders/test_build_linkcheck.py @@ -1127,6 +1127,12 @@ def test_too_many_requests_retry_after_HTTP_date(tz, app, monkeypatch, capsys): ) as address: app.build() + # Undo side-effects: the monkeypatch context manager clears the TZ environment + # variable, but we also need to reset Python's internal notion of the current + # timezone. + if sys.platform != 'win32': + time.tzset() + content = (app.outdir / 'output.json').read_text(encoding='utf8') assert json.loads(content) == { 'filename': 'index.rst',