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

Tests fail on 31st of a month #1053

Closed
mweinelt opened this issue Mar 31, 2022 · 0 comments · Fixed by #1086
Closed

Tests fail on 31st of a month #1053

mweinelt opened this issue Mar 31, 2022 · 0 comments · Fixed by #1086
Assignees

Comments

@mweinelt
Copy link

Not every month has 31 days. Tests ran v1.1.0.

____________________ ERROR collecting tests/test_search.py _____________________
/build/source/tests/test_search.py:12: in <module>
    class TestTranslateSearch(BaseTestCase):
/build/source/tests/test_search.py:471: in TestTranslateSearch
    ('June 2020', datetime.datetime(2020, 6, datetime.datetime.utcnow().day, 0, 0)),
E   ValueError: day is out of range for month
____________________ ERROR collecting tests/test_search.py _____________________
/build/source/tests/test_search.py:12: in <module>
    class TestTranslateSearch(BaseTestCase):
/build/source/tests/test_search.py:471: in TestTranslateSearch
    ('June 2020', datetime.datetime(2020, 6, datetime.datetime.utcnow().day, 0, 0)),
E   ValueError: day is out of range for month
=========================== short test summary info ============================
ERROR tests/test_search.py - ValueError: day is out of range for month
ERROR tests/test_search.py - ValueError: day is out of range for month
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
======================= 2 deselected, 2 errors in 3.96s ========================
mweinelt added a commit to mweinelt/nixpkgs that referenced this issue Sep 1, 2022
The dateparser module has a test that works with the current day of the
month and uses it in June 2020. This breaks everytime we build the
package on the 31st of a month, because June only has 30 days.

```
❯ cal 6 2020
      Juni 2020
Mo Di Mi Do Fr Sa So
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
```

scrapinghub/dateparser#1053
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Sep 1, 2022
The dateparser module has a test that works with the current day of the
month and uses it in June 2020. This breaks everytime we build the
package on the 31st of a month, because June only has 30 days.

```
❯ cal 6 2020
      Juni 2020
Mo Di Mi Do Fr Sa So
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
```

scrapinghub/dateparser#1053
(cherry picked from commit 0cece84)
RaitoBezarius pushed a commit to RaitoBezarius/nixpkgs that referenced this issue Sep 17, 2022
The dateparser module has a test that works with the current day of the
month and uses it in June 2020. This breaks everytime we build the
package on the 31st of a month, because June only has 30 days.

```
❯ cal 6 2020
      Juni 2020
Mo Di Mi Do Fr Sa So
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
```

scrapinghub/dateparser#1053
@gutsytechster gutsytechster self-assigned this Oct 17, 2022
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

Successfully merging a pull request may close this issue.

2 participants