Repository navigation
Stop a long-digit-run test depending on the current year - #1578
Merged
AdrianAtZyte merged 1 commit intoNov 13, 2026
Merged
Conversation
test_trailing_quantity_too_long_for_int_keeps_the_date_before_it reads "Sep 15" and expects 2026, but the year of a date written without one comes from the current date, so the test fails from 2027-01-01. Pass RELATIVE_BASE, as the other tests in this file already do.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1578 +/- ##
=======================================
Coverage 99.23% 99.23%
=======================================
Files 239 239
Lines 4203 4203
=======================================
Hits 4171 4171
Misses 32 32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AdrianAtZyte
approved these changes
Nov 13, 2026
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.
What was wrong
TestLongDigitRuns.test_trailing_quantity_too_long_for_int_keeps_the_date_before_itsearches"Sep 15, 2026 10:50 AM <5000 digits> years after"and expectsdatetime(2026, 9, 15). The text it matches is only"Sep 15", so the year comes from the current date, and the test fails from 2027-01-01: with the clock frozen at 2027-01-02 it gets 2027-09-15.How it is fixed
The call passes
settings={"RELATIVE_BASE": BASE}, as the other tests in this file already do.BASE(2026-11-03) is defined at the top of the file.Checks
With the clock frozen at 2027-01-02 (freezegun), the test fails on master and passes with this change. With the real clock it passes before and after.
The whole suite under the same frozen clock: this is the only test that fails on master and passes with this change. Nine other tests (
TestTimestampParserx4,TestDateData.test_reprx5) also fail under freezegun, but they fail the same way with the clock frozen at today's date and pass without freezegun, so they come from freezegun (local time conversion,FakeDatetimein reprs), not from the year.I have read the contributing guide and set up pre-commit.
🤖 Generated with Claude Code