pytest-dev / pytest-asyncio

Asyncio support for pytest
https://pytest-asyncio.readthedocs.io
Apache License 2.0
1.43k stars 152 forks source link

Documentation about how to set loop scope wrong? #905

Closed finswimmer closed 3 months ago

finswimmer commented 3 months ago

Hey,

the documentation here https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/run_session_tests_in_same_loop.html is saying that one can set the scope of the loop by the parameter loop_scope in either pytest.mark.asyncio or the given method in the conftest.py.

This doesn't work for me. But it works if I name the parameter scope instead. Is this a documentation issue?

Also setting the default scope as described https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/change_default_fixture_loop.html doesn't have any effect. Maybe that's related to my discovery above?

I'm using pytest-asyncio version 0.23.8.

fin swimmer

seifertm commented 3 months ago

You linked the documentation for the latest version which is the current development version on main. If you use v0.23.8, you need to select the corresponding version of the documentation on readthedocs: https://pytest-asyncio.readthedocs.io/en/v0.23.8/how-to-guides/run_session_tests_in_same_loop.html

The version switcher is located at the bottom left on the website.

finswimmer commented 3 months ago

:facepalm: Thanks for pointing me to the correct documentation :pray: