Skip to content

asyncio tests trigger deprecation warnings in 3.14 #5094

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

Closed
ngoldbaum opened this issue Apr 25, 2025 · 4 comments
Closed

asyncio tests trigger deprecation warnings in 3.14 #5094

ngoldbaum opened this issue Apr 25, 2025 · 4 comments

Comments

@ngoldbaum
Copy link
Contributor

In #4811 we're adding a pytest config file to ignore these warnings, but if you delete it you'll see after running the pytests:

.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:169: 3692 warnings
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:169: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    return asyncio.iscoroutinefunction(obj) or inspect.isasyncgenfunction(obj)

.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:433: 176 warnings
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:433: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    return asyncio.iscoroutinefunction(func)

.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:498: 10 warnings
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:498: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    and asyncio.iscoroutinefunction(func.hypothesis.inner_test)

tests/test_awaitable.py::test_iter_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:1005: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    return asyncio.get_event_loop_policy()

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:751: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    _restore_event_loop_policy(asyncio.get_event_loop_policy()),

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:977: DeprecationWarning: 'asyncio.set_event_loop_policy' is deprecated and slated for removal in Python 3.16
    asyncio.set_event_loop_policy(new_loop_policy)

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:978: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    loop = asyncio.get_event_loop_policy().new_event_loop()

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:766: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    policy = asyncio.get_event_loop_policy()

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:811: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    policy = asyncio.get_event_loop_policy()

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:835: DeprecationWarning: 'asyncio.set_event_loop_policy' is deprecated and slated for removal in Python 3.16
    asyncio.set_event_loop_policy(previous_policy)

tests/test_awaitable.py::test_iter_awaitable
tests/test_awaitable.py::test_future_awaitable
  /Users/goldbaum/Documents/pyo3/pytests/.nox/test/lib/python3.14t/site-packages/pytest_asyncio/plugin.py:847: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    policy = asyncio.get_event_loop_policy()
@ngoldbaum
Copy link
Contributor Author

pytest-dev/pytest-asyncio#1025 is the upstream issue, maybe I should close in favor of that?

@davidhewitt
Copy link
Member

Sure thing 👍

@davidhewitt davidhewitt closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2025
@seifertm
Copy link

pytest-dev/pytest-asyncio#1025 is the upstream issue, maybe I should close in favor of that?

Support for the development versions of Python 3.14 is now available in pytest-asyncio v1.0.0.

@ngoldbaum
Copy link
Contributor Author

Thanks! I opened #5165 to remove the warning filter we added to paper over this.

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

3 participants