Re-enable testEqualAmbiguousComparison on Python 3.7+ - #1552
Closed
pacocartones wants to merge 2 commits into
Closed
Re-enable testEqualAmbiguousComparison on Python 3.7+#1552pacocartones wants to merge 2 commits into
pacocartones wants to merge 2 commits into
Conversation
The test was skipped unconditionally with 'Known failure in Python 3.6.', but that CPython 3.6-era fold/ambiguous-comparison bug (PEP 495) was fixed in 3.7+. Switch the blanket skip to skipIf(sys.version_info < (3, 7)) so coverage is restored on every modern Python while the legacy CI jobs (2.7/3.5/3.6) still skip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TzFoldMixin.testEqualAmbiguousComparisonis skipped unconditionally:@unittest.skip("Known failure in Python 3.6.")The failure it guards against was a CPython 3.6-era bug in comparing ambiguous (fold) datetimes across separately-instantiated copies of the same zone (PEP 495 fold semantics), fixed in CPython 3.7+. On every supported modern Python the assertion holds, so the test is dead coverage for six subclasses (
GettzTest,ZoneInfoGettzTest,TZRangeTest,TZStrTest,TZICalTest,TzLocalNixTest).This switches the blanket skip to a version guard so the test runs again on 3.7+ while still skipping on the legacy interpreters CI continues to test:
@unittest.skipIf(sys.version_info < (3, 7), "Known failure in Python 3.6.")(
sysis already imported.) The re-enabled test uses realgettz(...)zone objects, so it exercises the actual fold-comparison path — CI on this PR confirms it passes across the modern matrix.