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

[Python 3.13.0b3] Address a deprecated call in testing/python/fixtures.py::test_getfuncargnames_partial #12552

Closed
webknjaz opened this issue Jul 1, 2024 · 6 comments · Fixed by #12558
Labels
good first issue easy issue that is friendly to new contributor type: infrastructure improvement to development/releases/CI structure type: selftests a problem in the tests of pytest

Comments

@webknjaz
Copy link
Member

webknjaz commented Jul 1, 2024

================================== FAILURES ===================================
________________________ test_getfuncargnames_partial _________________________

    def test_getfuncargnames_partial():
        """Check getfuncargnames for methods defined with functools.partial (#5701)"""
        import functools
    
        def check(arg1, arg2, i):
            raise NotImplementedError()
    
        class T:
            test_ok = functools.partial(check, i=2)
    
>       values = getfuncargnames(T().test_ok, name="test_ok")
E       FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in staticmethod() if you want to preserve the old behavior

testing\python\fixtures.py:89: FutureWarning

(https://github.com/pytest-dev/pytest/actions/runs/9745977844/job/26895224146#step:7:220)

@webknjaz webknjaz added good first issue easy issue that is friendly to new contributor type: infrastructure improvement to development/releases/CI structure type: selftests a problem in the tests of pytest labels Jul 1, 2024
@webknjaz webknjaz changed the title [Python 3.13] Address a deprecated call in testing/python/fixtures.py::test_getfuncargnames_partial [Python 3.13.0b3] Address a deprecated call in testing/python/fixtures.py::test_getfuncargnames_partial Jul 1, 2024
@ghost
Copy link

ghost commented Jul 3, 2024

Hello @webknjaz,
From the warning, one fix is to replace functools.partial(check, i=2) with staticmethod(functools.partial(check, i=2)). But this is exactly what the next test case checks for.
Do we get rid of test_getfuncargnames_partial entirely and rename test_getfuncargnames_staticmethod_partial to test_getfuncargnames_partial?

@webknjaz
Copy link
Member Author

webknjaz commented Jul 4, 2024

Dunno, but it seems like @Pierre-Sassoulas is about to do something about it..

@webknjaz
Copy link
Member Author

webknjaz commented Jul 4, 2024

Though, it'd be nice to submit that patch separately so that it could be backported easily.

@ghost
Copy link

ghost commented Jul 4, 2024

Sure!
The change mentioned skips the tests. I guess I'll submit a patch that does the same.

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Jul 4, 2024

Feel free to cherry-pick or open another MR, I think the pre-commit tool update could be merged fast, but I didn't realize that python 3.13 need to be handled on backporting branches too.

@webknjaz
Copy link
Member Author

webknjaz commented Jul 4, 2024

@Pierre-Sassoulas FYI you never needed to fix the 3.13 problem as those jobs are not required to pass and don't block merging. There's a flaky pypy3 job, though, that might need to be restarted occasionally (the fix is in the works).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor type: infrastructure improvement to development/releases/CI structure type: selftests a problem in the tests of pytest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants