gpt4 book ai didi

python - Pytest Xdist 不同的测试被收集错误

转载 作者:太空宇宙 更新时间:2023-11-04 02:47:31 26 4
gpt4 key购买 nike

第一次在这里发帖,过去 2 天我尝试搜索 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]

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

编辑:设置

Python 3.5.3
Pytest 3.1.2
Xdist 1.17.1

最佳答案

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

关于python - Pytest Xdist 不同的测试被收集错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44708770/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com