首页 > 解决方案 > pytest & pytest-benchmark:串行还是并行?

问题描述

  1. 在单个文件中:test.py,我有 3 个测试功能:test1(), test2(), test3(). pytest是并行还是pytest-benchmark串行运行这 3 个测试用例?

  2. 我有 3 个文件:test1.py, test2.py, test3.py. 分别地,我在每个文件中都有一个测试函数:test1(), test2(), test3(). 如果我只是运行pytestpytest-benchmark在它们所在的目录中,这 3 个测试是并行运行还是串行运行?

标签: python-3.xpytestpytest-benchmark

解决方案


根据Reddit 上crosspost 的回复和上面的评论,

pytestpytest-benchmark始终串行运行。


推荐阅读