Skip to content

Tests fail after 2025-12-31 #1286

@bmwiedemann

Description

@bmwiedemann

While working on reproducible builds for openSUSE, I found that
our python-dateparser 1.2.2 package fails its tests when run after 2026-01-01T01:06:13

 self = <tests.test_search.TestTranslateSearch testMethod=test_search_dates_with_prepositions>

     def test_search_dates_with_prepositions(self):
         """Test `search_dates` for parsing Russian date ranges with prepositions and language detection."""
         result = search_dates(
             "Сервис будет недоступен с 12 января по 30 апреля.",
             add_detected_language=True,
             languages=["ru"],
         )
         expected = [
             ("12 января", datetime.datetime(2025, 1, 12, 0, 0), "ru"),
             ("30 апреля", datetime.datetime(2025, 4, 30, 0, 0), "ru"),
         ]   
 >       assert result == expected
 E       AssertionError: assert [('12 января'... 0, 0), 'ru')] == [('12 января'... 0, 0), 'ru')]
 E       
 E         At index 0 diff: ('12 января', datetime.datetime(2041, 1, 12, 0, 0), 'ru') != ('12 января', datetime.datetime(2025, 1, 12, 0, 0), 'ru')
 E           
 E         Full diff:
 E           [
 E               (
 E                   '12 января',...
 E         
 E         ...Full output truncated (15 lines hidden), use '-vv' to show

Tests should keep working in the future. e.g. you could mock the current time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions