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

pytest-subtests deprecation warning #38

Closed
reaperhulk opened this issue Feb 20, 2021 · 6 comments · Fixed by #60
Closed

pytest-subtests deprecation warning #38

reaperhulk opened this issue Feb 20, 2021 · 6 comments · Fixed by #60

Comments

@reaperhulk
Copy link
Contributor

pytest-subtests uses CaptureFixture in pytest_subtests.py, which causes the following warning on pytest (at least as of latest pytest):

PytestDeprecationWarning: A private pytest class or function was used.
@nicoddemus
Copy link
Member

Thanks @reaperhulk,

Yeah unfortunately there's no way around it currently, I think.

Hopefully we will be able to get this into pytest itself before 7.0.

jonasehrlich added a commit to jonasehrlich/argparse-shell that referenced this issue Oct 17, 2021
Two warnings were showing regularly:

1) When asyncio.get_event_loop was used a DeprecationWarning was raised,
   because asyncio.get_event_loop will be an alias for
   asyncio.get_running_loop in future Python releases.
   The fix for this issue to directly use asyncio.get_running_loop,
   catch the RuntimeError if no loop is running and use asyncio.run.

2) 'A private pytest class or function was used' DeprecationWarning by
   pytests. This is caused by pytest-subtests and is tracked in
   pytest-dev/pytest-subtests#38
   No solution except disabling this warning was found.
@benbc
Copy link

benbc commented Jan 14, 2022

Looks like this might be fixed by #52, although that doesn't reference this issue and isn't released yet.

@nicoddemus
Copy link
Member

Thanks @benbc

@alex
Copy link
Contributor

alex commented Feb 12, 2022

FWIW this now warns with:

  /Users/alex_gaynor/projects/cryptography/.venv/lib/python3.9/site-packages/pytest_subtests.py:193: PytestDeprecationWarning: A private pytest class or function was used.
    return CallInfo(

@nicoddemus
Copy link
Member

Thanks @alex, just released 0.7.0 fixing this.

@alex
Copy link
Contributor

alex commented Feb 13, 2022

Thanks!

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.

4 participants