pytest-xdist 因 pytest-cov 错误而崩溃

Sre*_* TP 7 python unit-testing pytest python-3.x pytest-xdist

我试图通过主节点的 ssh 在远程计算机上对我的包执行测试。两个节点都安装了相同版本的软件包。

我正在这样进行测试

pytest -d --tx ssh=ubuntu//python=python3  --rsyncdir /home/ubuntu/pkg/ /home/ubuntu/pkg -n 7
Run Code Online (Sandbox Code Playgroud)

运行此程序时,我收到以下错误,

------------------------------ coverage ------------------------------
---------------------- coverage: failed workers ----------------------
The following workers failed to return coverage data, ensure that pytest-cov is installed on these workers.
gw0
gw1
gw2
gw3
gw4
gw5
gw6
Coverage XML written to file coverage.xml
Run Code Online (Sandbox Code Playgroud)

我已确保工作节点中安装了覆盖范围。

coverage==6.2
pytest-cov==3.0.0
Run Code Online (Sandbox Code Playgroud)

我不知道为什么它仍然失败。

我还注意到,由于某种原因,代码文件尚未在工作计算机中同步。

我试图了解这里出了什么问题以及如何解决这个问题。

fox*_*pal 0

由于与 pytest、pytest-cov 或 pytest-xdist 无关的问题,我出现了此错误 - 我的一些 python 导入是错误的。

首先修复其他代码问题可能值得一试。