pytest-trio icon indicating copy to clipboard operation
pytest-trio copied to clipboard

Refactor everything and use the same logic as pytest-anyio

Open jakkdl opened this issue 1 year ago • 5 comments

https://anyio.readthedocs.io/en/stable/testing.html has a much cleaner implementation at a fraction of the code size: https://github.com/agronholm/anyio/blob/master/src/anyio/pytest_plugin.py

Discussions in Gitter also suggests people prefer running pytest-anyio in trio mode over directly running pytest-trio.

This would also resolve #137, #124, probably #123, #89, #57, and surely a whole host of other issues.

EDIT: it would also resolve the problem of yield raising trio.Cancelled and making teardown not get executed unless it's inside a finally: https://pytest-trio.readthedocs.io/en/stable/reference.html#an-important-note-about-yield-fixtures

jakkdl avatar Sep 17 '24 15:09 jakkdl