average-breakfast-91545
07/30/2025, 9:41 PMasync def functions are not natively supported.
You need to install a suitable plugin for your async framework, for example:
- anyio
- pytest-asyncio
- pytest-tornasync
- pytest-trio
- pytest-twisted
Which implies that pytest-asyncio is not installed. pytest-asyncio is in the lockfile for both "edge" and the "pytest" resolve. I'm unsure where to go with this, or where to poke at it to try and reproduce.fast-nail-55400
07/30/2025, 10:02 PMpants.toml
?elegant-florist-94385
07/30/2025, 10:03 PM[pytest]
install_from_resolve = "universal_resolve"
requirements = [
"//3rdparty/python:poetry#pytest",
"//3rdparty/python:poetry#pytest-asyncio",
]
I have this in my pants.toml.
You might need something similar to enforce that pants knows to pick up the plugin dependencyfast-nail-55400
07/30/2025, 10:03 PMelegant-florist-94385
07/30/2025, 10:04 PMaverage-breakfast-91545
07/30/2025, 10:07 PM[pytest]
install_from_resolve = "pytest"
execution_slot_var = "PANTS_EXECUTION_SLOT"
args = [
# This means we don't need to add the @pytest.mark.asyncio decorator above
# async tests.
"--asyncio-mode=auto",
]
# Include plugins and things that should be ambiently available here.
requirements = [
"//3rdparty/python:pytest",
]
I'm a little confused by the interaction between pants.toml and pants.ci.toml here - from memory, the ci toml is merged with the base configuration, overriding things that are specified for ci?average-breakfast-91545
07/30/2025, 10:08 PMaverage-breakfast-91545
07/30/2025, 10:12 PM❯ pants list 3rdparty/python:pytest
Does return 3rdparty/python:pytest#pytest-asyncioaverage-breakfast-91545
07/30/2025, 10:20 PM3rdparty/python:test#time-machine@resolve=edge
though interestingly, nothing for resolve=pytest
. 🤔average-breakfast-91545
08/14/2025, 6:01 AM