pytest: error: unrecognized arguments: --html

记录一下 pytest: error: unrecognized arguments: --html 错误
安装完pytest 执行 pytest --html=report/report.html
发现出现
pytest: error: unrecognized arguments: --html
无法识别的参数,然后搜了一下
pip install pytest-html
就可以了

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在使用pytest时,出现"unrecognized arguments"错误通常是由于命令行参数不正确导致的。根据提供的引用内容,你遇到的错误是"unrecognized arguments: --alluredir"和"unrecognized arguments: -n"。下面是解决这两个问题的方法: 1. 对于"unrecognized arguments: --alluredir"错误,这是因为pytest识别"--alluredir"参数。要解决这个问题,你可以尝试以下方法: - 确保你已经正确安装了pytest和allure-pytest插件。 - 检查你的命令行中是否正确使用了"--alluredir"参数。确保参数前面有两个连字符"--",而不是一个破折号"-"。 - 确保你的pytest版本和allure-pytest插件版本兼容。有时候,不同版本的pytest和插件之间可能存在兼容性问题。 2. 对于"unrecognized arguments: -n"错误,这是因为pytest识别"-n"参数。要解决这个问题,你可以尝试以下方法: - 确保你已经正确安装了pytest-xdist插件。"-n"参数是pytest-xdist插件提供的,用于并行运行测试用例。 - 检查你的命令行中是否正确使用了"-n"参数。确保参数前面有一个破折号"-",而不是两个连字符"--"。 - 确保你的pytest版本和pytest-xdist插件版本兼容。有时候,不同版本的pytest和插件之间可能存在兼容性问题。 请注意,以上方法仅供参考,具体解决方法可能因环境和版本而异。如果问题仍然存在,请提供更多详细信息,以便我能够更好地帮助你解决问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值