scrapinghub / dateparser

python parser for human readable dates
BSD 3-Clause "New" or "Revised" License
2.56k stars 465 forks source link

Tests fail with latest pytz update #1237

Open K900 opened 1 month ago

K900 commented 1 month ago
=================================== FAILURES ===================================
_____________ TestTranslateSearch.test_relative_base_setting_2_en ______________

a = (<tests.test_search.TestTranslateSearch testMethod=test_relative_base_setting_2_en>,)
kw = {}

    @wraps(func)
    def standalone_func(*a, **kw):
>       return func(*(a + p.args), **p.kwargs, **kw)

/nix/store/7pgb7m7vhzrpil0cicvg33cwq9jyx2f8-python3.12-parameterized-0.9.0/lib/python3.12/site-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/build/source/dateparser/conf.py:100: in wrapper
    return f(*args, **kwargs)
/build/source/tests/test_search.py:720: in test_relative_base_setting
    self.assertEqual(result, expected)
E   AssertionError: Lists differ: [('Ma[201 chars]nfo=<StaticTzInfo 'UTC'>)), ('June 5 am utc', [283 chars]'>))] != [('Ma[201 chars]nfo=<UTC>)), ('June 5 am utc', datetime.dateti[259 chars]C>))]
E
E   First differing element 5:
E   ('Jun[43 chars], 23, 17, 0, tzinfo=<StaticTzInfo 'EST'>))
E   ('Jun[43 chars], 23, 17, 0, tzinfo=<DstTzInfo 'EST' LMT-1 day, 18:42:00 STD>))
E
E   Diff is 1289 characters long. Set self.maxDiff to None to see it.
=========================== short test summary info ============================
FAILED tests/test_search.py::TestTranslateSearch::test_relative_base_setting_2_en - AssertionError: Lists differ: [('Ma[201 chars]nfo=<StaticTzInfo 'UTC'>)), (...
========== 1 failed, 23910 passed, 14 skipped, 2 deselected in 35.15s ==========

Looks like the EST timezone changed description.

wRAR commented 1 month ago

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1084190 for the details of the tzdata change.