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

Test failure with Python 3.12 #202

Open
fabaff opened this issue Mar 21, 2024 · 2 comments
Open

Test failure with Python 3.12 #202

fabaff opened this issue Mar 21, 2024 · 2 comments

Comments

@fabaff
Copy link

fabaff commented Mar 21, 2024

Describe the bug
Tests starting to fail with python 3.12. They are passing with Python 3.11.

============================= test session starts ==============================
platform linux -- Python 3.12.2, pytest-7.4.4, pluggy-1.4.0
rootdir: /build/source
plugins: mock-3.12.0, time_machine-2.13.0
collected 277 items                                                            

tests/test_maya.py ..FF................................................. [ 19%]
........................................................................ [ 45%]
................................................................         [ 68%]
tests/test_maya_interval.py ............................................ [ 84%]
............................................                             [100%]

=================================== FAILURES ===================================
____ test_parse_iso8601[20161001T1430.4+05:30-2016-10-01T09:00:00.400000Z] _____

text = '20161001T1430.4+05:30'
[...]
        # We couldn't parse the string
        # so we fallback on the dateutil parser
        # If not strict
        if options.get("strict", True):
            raise ParserError(f"Unable to parse string [{text}]")
    
        try:
            dt = parser.parse(
                text, dayfirst=options["day_first"], yearfirst=options["year_first"]
            )
        except ValueError:
>           raise ParserError(f"Invalid date string: {text}")
E           pendulum.parsing.exceptions.ParserError: Invalid date string: 2016T14

/nix/store/93iilxyrqxs4l1da1c595w8l8ga9g5s8-python3.12-pendulum-3.0.0/lib/python3.12/site-packages/pendulum/parsing/__init__.py:132: ParserError
=============================== warnings summary ===============================
tests/test_maya.py: 669 warnings
tests/test_maya_interval.py: 530 warnings
  /build/source/maya/core.py:250: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    dt = Datetime.utcfromtimestamp(self._epoch)

tests/test_maya.py::test_issue_104
  /build/source/tests/test_maya.py:81: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    t = Datetime.utcfromtimestamp(e)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_maya.py::test_parse_iso8601[20161001T1430.4+05:30-2016-10-01T09:00:00.400000Z] - pendulum.parsing.exceptions.ParserError: Invalid date string: 20161001T1430...
FAILED tests/test_maya.py::test_parse_iso8601[2016T14-2016-01-01T14:00:00Z] - pendulum.parsing.exceptions.ParserError: Invalid date string: 2016T14
================= 2 failed, 275 passed, 1200 warnings in 1.81s =================

Environment and Version

  • OS (incl. terminal and shell used): not relevant
  • Python Version: 3.12
  • maya Version: 0.6.1
  • Your timezone: not relevant

To Reproduce
Run tests

Expected behavior
Tests to pass with Python 3.12

Screenshots
If applicable, add screenshots to help explain your problem.

Relevant log files
If applicable, information from log files supporting your claim.

Additional context
Add any other context about the problem here.

@timofurrer
Copy link
Collaborator

I'm not maintaining this any more.

Looking for maintainers here: #197 - no luck so far.

If anyone wants to contribute this, don't hesitate :)

@ghost
Copy link

ghost commented Mar 22, 2024

@fabaff I was able to reproduce the same test results with python3.11 as well. Digging down deep, the issue is arising from pendulum version. From 3.0.0a1, these tests are failing. If the dependency is downgraded to 2.1.2, the tests are not failing.

My suggestion would be understanding whether these two date formats 20161001T1430.4+05:30-2016-10-01T09:00:00.400000Z and 2016T14-2016-01-01T14:00:00Z are still valid according to iso8601 and remove from tests if they are not.

@timofurrer I am interested in maintaining the repo, even though I do not have much of experience in open source, but I do have experience in handling projects in work for last 8 years.

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