Pytest Xdist 不同测试收集错误

Jac*_*ero 3 python pytest xdist pytest-xdist

第一次在这里发帖,过去两天我尝试搜索 xdist 问题的解决方案。当我尝试以 n=2 或更高的值运行时,有时(我说有时是因为它随机工作)会出现以下错误:

Different tests were collected between gw1 and gw0. The difference is:
--- gw1

+++ gw0

@@ -1,2 +1,2 @@

+test_Sign_Up.py::test_sign_up[chrome]  test_Sign_Up.py::test_sign_up[firefox]
-test_Sign_Up.py::test_sign_up[chrome]
Run Code Online (Sandbox Code Playgroud)

抱歉,如果这是一个很容易解决的问题,但在看了很多其他帖子后,我个人觉得我没有找到答案。如果需要更多信息,请告诉我,我会尽快回复!谢谢你!

编辑:设置

Python 3.5.3
Pytest 3.1.2
Xdist 1.17.1
Run Code Online (Sandbox Code Playgroud)

ren*_*tze 5

如果使用最近发布的 pytest 3.2 不能修复您的错误,请尝试使用固定数字播种 python 解释器的哈希,以获得依赖哈希的结构的稳定排序: PYTHONHASHSEED=0 pytest -n 2