breezy-electrician-41537
05/04/2024, 3:43 PMpytest, and in vscode, but passes with pants:
@pytest.mark.asyncio
async def test_foo():
# await asyncio.sleep(1)
assert 2 == 4
Commenting or uncommenting the sleep doesn't make a difference. Is there a workaround? Is this a bug?better-van-82973
05/04/2024, 9:24 PMpytest-asyncio plugin installed in your Pants resolve?breezy-electrician-41537
05/04/2024, 11:21 PMbetter-van-82973
05/04/2024, 11:24 PM[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
ipython = "^8.24.0"
jupyterlab = "^4.0.0"
matplotlib = "^3.6.0"
requests_cache = "^1.0.0"
pytest-mock = "^3.12.0"
faker = "^25.0.0"
pytest-asyncio = "^0.23.0"
Using Pants, you can create a custom resolve for Pytest that includes any test packages you need: https://www.pantsbuild.org/2.21/docs/python/overview/lockfiles#getting-started-with-resolvesbreezy-electrician-41537
05/04/2024, 11:27 PMbetter-van-82973
05/04/2024, 11:29 PM[pytest]
args = ["-vv", "-s"]
install_from_resolve = "python-default"
requirements = ["greenlet", "pytest-asyncio", "pytest-cov", "pytest-mock", "pytest-aiohttp"]
The requirements field is what passes through the plugins, Iād forgotten about that. Docs here.breezy-electrician-41537
05/04/2024, 11:53 PM