huggingface / dataset-viewer

Lightweight web API for visualizing and exploring any dataset - computer vision, speech, text, and tabular - stored on the Hugging Face Hub
https://huggingface.co/docs/datasets-server
Apache License 2.0
640 stars 65 forks source link

Async tests using anyio are skipped after including pytest-memray #2901

Closed albertvillanova closed 3 weeks ago

albertvillanova commented 3 weeks ago

Async tests using anyio are currently skipped. See: https://github.com/huggingface/dataset-viewer/actions/runs/9464138411/job/26070809625

tests/test_authentication.py ssssssssssssssssssssssssssssssssssssssssssssss

=============================== warnings summary ===============================
  /home/runner/.cache/pypoetry/virtualenvs/libapi-QfqNi3gs-py3.9/lib/python3.9/site-packages/_pytest/python.py:151: PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped.
  You need to install a suitable plugin for your async framework, for example:
    - anyio
    - pytest-asyncio
    - pytest-tornasync
    - pytest-trio
    - pytest-twisted
    warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))

tests/test_authentication.py::test_no_external_auth_check
  /home/runner/.cache/pypoetry/virtualenvs/libapi-QfqNi3gs-py3.9/lib/python3.9/site-packages/pymongo/topology.py:498: RuntimeWarning: coroutine 'test_no_external_auth_check' was never awaited
...

After investigation, I found that the issue arose after including pytest-memray by PR:

I have reported the issue to pytest-memray team:

severo commented 3 weeks ago

Let's remove --memray I think. I don't think we need it (it only shows a report of the four more memory-consuming tests), we're more interested in specific tests using decorators like @pytest.mark.limit_memory, no?