Skip to content
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

FAIL: testDate3ConfusedHourAndYear (tests.TestComplexDateTimes.test) #263

Open
exarkun opened this issue Jun 30, 2021 · 1 comment
Open
Assignees

Comments

@exarkun
Copy link

exarkun commented Jun 30, 2021

======================================================================
FAIL: testDate3ConfusedHourAndYear (tests.TestComplexDateTimes.test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/parsedatetime-2.4/tests/TestComplexDateTimes.py", line 47, in testDate3ConfusedHourAndYear
    6, 30, 12, 0, 0).timetuple(), 3))
  File "/build/parsedatetime-2.4/tests/utils.py", line 22, in decoratedComparator
    self.fail(failureMessage % (errMsg, result, check))
AssertionError: Result does not match target value

        Result:
        (time.struct_time(tm_year=2021, tm_mon=6, tm_mday=30, tm_hour=12, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=181, tm_isdst=-1), 3)

        Expected:
        (time.struct_time(tm_year=2022, tm_mon=6, tm_mday=30, tm_hour=12, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=181, tm_isdst=-1), 3)

----------------------------------------------------------------------

Today is June 30th and the failing assertion is operating on June 30th without a year specified so I suppose this is a test that always fails on June 30th.

@bear bear self-assigned this Nov 20, 2021
@bear
Copy link
Owner

bear commented Nov 20, 2021

This is happening because the code is only looking at the month and day to determine if it is being asked to parse a future date or past date. I'm looking at how to see if the parsed date has the context of a time (context.hasTime), and if so, if that month, day, hour is future or past

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

No branches or pull requests

2 participants