Appium error: unrecognized arguments: --count=2

醋精测试媛 · June 01, 2021 · Last by 醋精测试媛 replied at June 01, 2021 · 4772 hits

pytest.ini 中设置如下:

运行代码:

import pytest

if __name__ == '__main__':
    pytest.main(["-m", "login"])

但是出现了问题:
ERROR: usage: main.py [options] [file_or_dir] [file_or_dir] [...]
main.py: error: unrecognized arguments: --count=2

第一次使用 pycharm 运行 pytest,请教大家问题出在哪里?

共收到 6 条回复 时间 点赞

我已经安装了 pytest-rerunfailures

但是没有用

rerunfailures 貌似没有 count 这个参数

查了下,你用的这个 count 参数是另外一个重试插件 pytest-repeat 的参数

Vin 回复

谢谢,我将插件 pytest-repeat 安装,并卸载了之前的,确认了插件 pytest-repeat 有 reruns 这个参数,但是仍然出现了 error: unrecognized arguments: --reruns=1,这个是什么原因呢

醋精测试媛 关闭了讨论 01 Jun 19:47
醋精测试媛 重新开启了讨论 01 Jun 20:21
Vin 回复

不好意思,被网上的资料误导了,我懂了,插件 pytest-repeat 没有 reruns 这个参数

醋精测试媛 关闭了讨论 02 Jun 13:34
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up