py.test 夹具范围 'session' 每 module/file 执行一次。是否有可用的全局单个 运行 夹具范围选项?

py.test fixture scoped 'session' is executing once per module/file. Is there a global single run fixture scoping option available?

有人对此有任何见解吗?我试图找出 'session' 和 'module' 范围之间的区别。

这个问题以前曾用不同的术语问过,但从未真正回答过。

谢谢。

恐怕你的标题是错误的 - session 作用域固定装置正是你所要求的(运行每个 测试 session),而 module 作用域固定装置 运行 每个模块(即文件)一次。