1

嗨,我正在尝试在 azure 管道上并行运行我的测试(pytest-xdist)。到目前为止,测试运行得非常好。突然,pytest 抛出一个奇怪的错误,说“无法识别的参数”。

文件名:integration_test.py 使用的命令:pytest -n 5 --tb=short integration_test.py -v -s --> 并行运行 5 个测试 测试总数:57 个版本:pytest==6.2.5 pytest- xdist==2.3.0 甚至尝试使用这两个模块的最新版本。

错误:错误:用法:pytest [options] [file_or_dir] [file_or_dir] [...] pytest:错误:无法识别的参数:-n integration_test.py

我该如何克服这个错误?

4

1 回答 1

0

这个错误是你遇到的:

在此处输入图像描述

正如 hoefling 提到的,解决方案是安装 pytest-xdist:

pip install pytest-xdist

于 2022-01-10T02:26:15.090 回答