CI failing on humanize test
See original GitHub issueIssue Description
Current CRON CI build on master is failing. The test case tests/test_arrow.py::TestArrowHumanize::test_day
is failing on the current master between 7:00-7:59pm EST. The tests pass when run at 8pm EST.
__________________________ TestArrowHumanize.test_day __________________________
self = <tests.test_arrow.TestArrowHumanize object at 0x7f851fcb8128>
def test_day(self):
later = self.now.shift(days=1)
assert self.now.humanize(later) == "a day ago"
assert later.humanize(self.now) == "in a day"
# regression test for issue #697
less_than_48_hours = self.now.shift(
days=1, hours=23, seconds=59, microseconds=999999
)
assert self.now.humanize(less_than_48_hours) == "a day ago"
assert less_than_48_hours.humanize(self.now) == "in a day"
less_than_48_hours_date = less_than_48_hours._datetime.date()
with pytest.raises(TypeError):
# humanize other argument does not take raw datetime.date objects
self.now.humanize(less_than_48_hours_date)
# convert from date to arrow object
less_than_48_hours_date = arrow.Arrow.fromdate(less_than_48_hours_date)
> assert self.now.humanize(less_than_48_hours_date) == "a day ago"
E AssertionError: assert '23 hours ago' == 'a day ago'
E - a day ago
E + 23 hours ago
tests/test_arrow.py:1851: AssertionError
This test case reproduces it locally:
import arrow
now = arrow.Arrow(2020, 12, 1, 0, 55, 46, 798518)
print("now:", now)
less_than_48_hours = now.shift(
days=1, hours=23, seconds=59, microseconds=999999
)
print("less_than_48_hours:", less_than_48_hours)
less_than_48_hours_date = arrow.Arrow.fromdate(less_than_48_hours._datetime.date())
print("less_than_48_hours_date:", less_than_48_hours_date)
humanized = now.humanize(less_than_48_hours_date)
print("humanized:", humanized)
# Should be "a day ago"
assert humanized == "a day ago"
System Info
- 🖥 OS name and version: macOS 11.0
- 🐍 Python version: 3.9.0
- 🏹 Arrow version: latest
master
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Log - HEAD - third_party/go-humanize - Git at Google
9f541cc Adds commas to number formatting in english.Plural. by Chris Conway · 4 years, 4 months ago main master v1.0.0 · 02af396 Added...
Read more >humanize-duration - npm
Start using humanize-duration in your project by running `npm i humanize-duration`. There are 404 other projects in the npm registry using ...
Read more >Humanizer by Humanizr
Humanizer. Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities.
Read more >The Humanizing Voice: Speech Reveals, and Text Conceals ...
Humanizing Voice. 3 medium lacking voice (i.e., transcript). By comparing the audiovisual and audio conditions, we further tested.
Read more >Humanized mouse models of clinical disease - PMC - NCBI
Unfortunately, mouse models of tuberculosis usually fail to form ... Humanized mice have been used to test and compare the function and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ugh good find. Might be related to https://github.com/arrow-py/arrow/issues/749
This was one of the problems I encountered in #868. Any value we pick for
_SECS_PER_MONTH
will result in something being wrong. To fix this properly the “month” duration has to be calculated at runtime imo.The annoying thing is that this could break installation in some cases. I suggest we find a fix before 1.0.0 or mark the month test as xfail for now.