Python pytest 资深大佬进,求助,

€¶婷姐儿♛ 测试交流评论101字数 340阅读模式

问题:

同时使用 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

预期:文章源自玩技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

玩技站长微信
添加好友自动发送入群邀请
weinxin
rainbow-shownow
玩技官方公众号
官方微信公众号
weinxin
PLAYEZU
 
  • 版权提示:本站仅供存储任何法律责任由作者承担▷诈骗举报◁▷新闻不符◁▷我要投稿◁
    风险通知:非原创文章均为网络投稿真实性无法判断,侵权联系2523030730
    免责声明:内容来自用户上传发布或新闻客户端自媒体,切勿!切勿!切勿!添加联系方式以免受骗。
  • 原创转载:https://www.playezu.com/180534.html
    转载说明: 点我前往阅读>>>
匿名

发表评论

匿名网友
确定