scrapinghub / scrapinghub/dateparser

Tests fail with latest pytz update

Open
#1,237 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

=================================== 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/test_search.py::TestTranslateSearch::test_relative_base_setting_2_en and the failure output, then inspect how the relative base setting handles EST and UTC timezone objects. Determine the compatibility change needed for the latest pytz behavior and rerun this test and the full test suite; done means the failing test passes without regressing the other reported results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.