Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jayaddison
Copy link
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
22 of 24 checks passed
@jayaddison jayaddison deleted the tests/linkcheck-pytest-monkeypatch-tzset-teardown branch May 12, 2025 17:14
@jayaddison
Copy link
Contributor Author

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants