aio-libs / aioftp

ftp client/server for asyncio (http://aioftp.readthedocs.org)
Apache License 2.0
185 stars 54 forks source link

Pytest Asyncio 0.17.2: Deprecation Warning #159

Closed Hellseher closed 1 year ago

Hellseher commented 1 year ago

Hi,

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 commented 1 year ago

Mostly same as here https://github.com/pohmelie/siosocks/issues/7

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

Hellseher commented 1 year ago

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.