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 Asyncio 0.17.2: Deprecation Warning #159

Closed
Hellseher opened this issue Oct 12, 2022 · 2 comments
Closed

Pytest Asyncio 0.17.2: Deprecation Warning #159

Hellseher opened this issue Oct 12, 2022 · 2 comments

Comments

@Hellseher
Copy link

Hi,

  • Python 3.9
  • Pytest Asyncio 0.17.2

While packing your project for Guix I've got few deprecation warnings during check phase:

tests/test_user.py::test_user_not_absolute_home PASSED                   [100%]

=============================== warnings summary ===============================
../../../gnu/store/hm97w6qgapy8x7i341mhcdn7j3jxfb42-python-pytest-asyncio-0.17.2/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191
  /gnu/store/hm97w6qgapy8x7i341mhcdn7j3jxfb42-python-pytest-asyncio-0.17.2/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'async
io_mode=auto' in pytest configuration file.
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

tests/test_abort.py: 10 warnings
tests/test_client_side_socks.py: 8 warnings
tests/test_connection.py: 44 warnings
tests/test_corner_cases.py: 14 warnings
tests/test_current_directory.py: 8 warnings
tests/test_directory_actions.py: 18 warnings
tests/test_extra.py: 6 warnings
tests/test_file.py: 46 warnings
tests/test_list_fallback.py: 10 warnings
tests/test_login.py: 16 warnings
tests/test_maximum_connections.py: 10 warnings
tests/test_passive.py: 20 warnings
tests/test_permissions.py: 4 warnings
tests/test_restart.py: 22 warnings
tests/test_throttle.py: 168 warnings
  /tmp/guix-build-python-aioftp-0.21.3.drv-0/aioftp-0.21.3/tests/conftest.py:118: DeprecationWarning: with timeout() is deprecated, use async with timeout() instead
    self.timeout.__enter__()

tests/test_client_side_socks.py::test_socks_success[127.0.0.1-socks0]
  /gnu/store/hm97w6qgapy8x7i341mhcdn7j3jxfb42-python-pytest-asyncio-0.17.2/lib/python3.9/site-packages/pytest_asyncio/plugin.py:317: DeprecationWarning: '@pytest.fixture' is applied to <fixture socks, file=/tmp/guix-build-python-aioftp-0.21.3.drv-0/aioftp-0.21.3/tests/conft
est.py, line=194> in 'legacy' mode, please replace it with '@pytest_asyncio.fixture' as a preparation for switching to 'strict' mode (or use 'auto' mode to seamlessly handle all these fixtures as asyncio-driven).
    warnings.warn(

tests/test_pathio.py::test_exists[MemoryPathIO]
  /gnu/store/hm97w6qgapy8x7i341mhcdn7j3jxfb42-python-pytest-asyncio-0.17.2/lib/python3.9/site-packages/pytest_asyncio/plugin.py:317: DeprecationWarning: '@pytest.fixture' is applied to <fixture temp_dir, file=/tmp/guix-build-python-aioftp-0.21.3.drv-0/aioftp-0.21.3/tests/co
nftest.py, line=156> in 'legacy' mode, please replace it with '@pytest_asyncio.fixture' as a preparation for switching to 'strict' mode (or use 'auto' mode to seamlessly handle all these fixtures as asyncio-driven).
    warnings.warn(

tests/test_throttle.py::test_patched_sleep
  /gnu/store/hm97w6qgapy8x7i341mhcdn7j3jxfb42-python-pytest-asyncio-0.17.2/lib/python3.9/site-packages/pytest_asyncio/plugin.py:317: DeprecationWarning: '@pytest.fixture' is applied to <fixture monkeypatch, file=/gnu/store/7frqm5ijy66f81hr8i1j6791k84lds9w-python-pytest-6.2.
5/lib/python3.9/site-packages/_pytest/monkeypatch.py, line=29> in 'legacy' mode, please replace it with '@pytest_asyncio.fixture' as a preparation for switching to 'strict' mode (or use 'auto' mode to seamlessly handle all these fixtures as asyncio-driven).
    warnings.warn(

tests/test_throttle.py::test_patched_sleep
  /gnu/store/hm97w6qgapy8x7i341mhcdn7j3jxfb42-python-pytest-asyncio-0.17.2/lib/python3.9/site-packages/pytest_asyncio/plugin.py:317: DeprecationWarning: '@pytest.fixture' is applied to <fixture skip_sleep, file=/tmp/guix-build-python-aioftp-0.21.3.drv-0/aioftp-0.21.3/tests/
conftest.py, line=186> in 'legacy' mode, please replace it with '@pytest_asyncio.fixture' as a preparation for switching to 'strict' mode (or use 'auto' mode to seamlessly handle all these fixtures as asyncio-driven).
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================== 778 passed, 409 warnings in 4.12s =======================
@pohmelie
Copy link
Collaborator

Mostly same as here pohmelie/siosocks#7

I add low bound for async-timeout package and release 0.21.4 (it is on pypi already), so no more warnings.

@Hellseher
Copy link
Author

Hi,

You are supper quick with response and release!
I can confirm that with pytest-asynio 0.19.0 all test passed successfully without warnings:

tests/test_user.py::test_user_not_absolute_home PASSED                   [100%]

============================= 778 passed in 4.17s ==============================
phase `check' succeeded after 4.7 seconds

I'll prepare patches with the lates version for Guix.

Tnanks.

Hellseher added a commit to Hellseher/guix-ffab that referenced this issue Oct 19, 2022
* ffab/packages/python-xyz.scm (python-siosocks): Use
  python-pytest-asyncio-ffab (v0.19.0) to silent all warnings during check phase.
  - pohmelie/siosocks#7

* ffab/packages/python-xyz.scm (python-aioftp): Update to 0.21.4. Use
  python-pytest-asyncio-ffab (v0.19.0) to silent all warnings during check phase.
  - aio-libs/aioftp#159
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