繁体   English   中英

无法使用.bat 文件运行 pytest 命令,但在 pytest 终端中可以使用相同的命令

[英]Unable to run pytest command using .bat file but same command is ok in pytest terminal

I'm using this command in pytest terminal and it is running fine: pytest -v -s -m "sanity or regression or functional" --html=./Reports/report.html testCases/ --browser chrome --capture=三通系统

但是当我保存到 .bat 文件并以管理员身份运行时,同样的命令给出了无法导入 wedriver_manager 的错误。

附加两个快照。

run.bat - 不行

在此处输入图像描述

pycharm 端子-好的在此处输入图像描述

可能需要看代码。 但是,您可以尝试将--capture=tee-sys更改为--capture=sys ,尽管我认为这与 webdriver-manager 没有任何关系。 另外,您使用的是虚拟环境还是本地环境?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM