我使用Selenium Python创建了一些测试脚本,它们的工作正常。但是,当我尝试生成HTML报告或诱惑报告时,我遇到了麻烦。
我使用以下命令尝试生成pytest html报告:“ pipenv
运行python -m
pytest xxx/test_xxxxx.py -html = report
“。但是,我收到以下错误:“
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --html=report.html
inifile: None
rootdir: C:\Users\xxxx\xxxx"
。我已经安装了使用PIP Install Pytest-HTML
pytest-html 插件的 pytest-html
,所以我不确定我做错了什么。
- -report-html“> pytest:错误:未识别的参数:-html = report.html
-
有人有任何见解吗?
I created some test scripts using selenium python and they have been working okay. However, I have had trouble when I tried to generate an html report or an allure report.
I used the following command to try to generate a pytest html report: "pipenv
run python -m
pytest xxx/test_xxxx.py --html=report.html
". However, I got the following error: "
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --html=report.html
inifile: None
rootdir: C:\Users\xxxx\xxxx"
. I had installed the pytest-html
plugin using pip install pytest-html
, so I am not sure what I have been doing wrong.
I tried uninstalling and reinstalling, but that did not work. I also tried the following links (among others):
Does anyone have any insight?
发布评论
评论(1)
我想我找到了解决方案。由于我正在使用Pipenv进行测试,因此我也必须通过Pipenv安装依赖项。因此,对于HTML和Allure报告,完整的命令将如下:
尝试此操作后,我运行了以前的命令,并且不再遇到问题。
I think I have found the solution. Since I am using pipenv to run my tests, I would have to install the dependencies through pipenv as well. So for the html and allure reports, the full commands would be as follows:
After trying this, I ran my previous commands and I no longer got the issue.