Skip to content

Tests: linkcheck: ensure Python clock timezone is reset during test teardown - #13537

Merged
AA-Turner merged 3 commits into
sphinx-doc:masterfrom
jayaddison:tests/linkcheck-pytest-monkeypatch-tzset-teardown
May 12, 2025
Merged

AA-Turner merged 3 commits into
sphinx-doc:masterfrom
jayaddison:tests/linkcheck-pytest-monkeypatch-tzset-teardown

Conversation

@jayaddison

Copy link
Copy Markdown
Contributor

Purpose

Resolves a small quirk in the test_too_many_requests_retry_after_HTTP_date test case; after monkeypatching the TZ environment variable and calling time.tzset, the internal state is prepared correctly for each parameterized run of the test case.

The context manager for the monkeypatch clears the TZ environment variable, but doesn't intrinsically know that another time.tzset call is required to properly reset Python's system clock / timezone state.

References

cc @mitya57

@jayaddison

This comment was marked as resolved.

@jayaddison
jayaddison marked this pull request as draft May 9, 2025 12:27
@jayaddison

This comment was marked as resolved.

@jayaddison
jayaddison marked this pull request as ready for review May 9, 2025 12:30
@AA-Turner
AA-Turner merged commit e6d67ca into sphinx-doc:master May 12, 2025
@jayaddison
jayaddison deleted the tests/linkcheck-pytest-monkeypatch-tzset-teardown branch May 12, 2025 17:14
@jayaddison

Copy link
Copy Markdown
Contributor Author

Thanks again!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 6, 2025
@AA-Turner AA-Turner added this to the 9.0.0 milestone Nov 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants