问题:
同时使用 pytest.mark.parametrize 和 pytest.mark.asyncio 时,async 的效果会失效。文章源自玩技e族-https://www.playezu.com/180534.html
截图:文章源自玩技e族-https://www.playezu.com/180534.html

预期:文章源自玩技e族-https://www.playezu.com/180534.html
预期应该小幅度于 6 秒,但是程序是以串行的方式跑,总耗时 2*3==6 秒左右文章源自玩技e族-https://www.playezu.com/180534.html
stack overflow 的相关问题:文章源自玩技e族-https://www.playezu.com/180534.html
https://stackoverflow.com/questions/61821196/why-does-using-pytest-asyncio-and-parametrize-cause-tests-to-run-for-longer-tha文章源自玩技e族-https://www.playezu.com/180534.html
有人遇到一样的问题,暂时没有比较优雅的解决方案,说是 Run the tests in parallel with the pytest-xdist plugin,但是这受限于 cpu 核心,不是我想要的文章源自玩技e族-https://www.playezu.com/180534.html文章源自玩技e族-https://www.playezu.com/180534.html