Pytest allure 命令行參數(shù)的使用
先看看 allure 命令的幫助文檔
cmd 敲
allure -h
allure 命令的語法格式
allure [options] [command] [command options]
options 列表
Options: --help 命令行幫助文檔 -q, --quiet 切換至安靜模式 Default: false -v, --verbose 切換至冗長模式 Default: false --version 版本信息 Default: false
command 列表
- generate
- serve
- open
- plugin
這里只講前三個常用的
generate 命令行參數(shù)
作用
生成 allure 的html 報告
語法格式
generate [options] allure 結果目錄
注:allure 結果目錄就是運行 pytest 命令,--alluredir 跟的那個目錄
pytest -sq --alluredir= ./allure
命令選項
主要就是用 -c、-o 兩個參數(shù)
open 命令行參數(shù)
作用
打開生成的 allure 報告,就是打開 generate 命令生成的報告
語法格式
open [options] allure報告目錄
注:allure 報告目錄就是運行 allure generate 命令,-o 跟的那個目錄
allure generate -o ./allure-report
命令選項
serve 命令行參數(shù)
作用
打開 allure 報告
語法格式
serve [options] allure 結果目錄
注:allure 結果目錄就是運行 pytest 命令,--alluredir 跟的那個目錄
pytest -sq --alluredir= ./allure
命令選項
瀏覽器打開 allure 報告的兩種方式
allure serve
標準寫法
# 執(zhí)行 pytest,指定 allure 結果目錄 pytest -sq --alluredir=./allure # 打開 allure 報告 allure serve ./allure
allure generate + allure open
標準寫法
# 執(zhí)行 pytest,指定 allure 結果目錄 pytest -sq --alluredir=./allure # 生成 allure 的 html 報告 allure generate -c -o ./allure-report ./allure # 打開 allure 報告 allure open ./allure-report
當然不寫 -o 也可以
看看 allure-report 的目錄結構
- 這種方式的目錄會好看很多,不只是一堆 json 文件
- 而且直接打開 index.html 也是能看到 allure 報告的
到此這篇關于Pytest allure 命令行參數(shù)的使用的文章就介紹到這了,更多相關Pytest allure 命令行參數(shù)內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
caffe的python接口繪制loss和accuracy曲線
這篇文章主要為大家介紹了caffe的python接口繪制loss和accuracy曲線示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-06-06python3中的eval和exec的區(qū)別與聯(lián)系
這篇文章主要介紹了python3中的eval和exec的區(qū)別與聯(lián)系,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2019-10-10Python實現(xiàn)爬蟲從網(wǎng)絡上下載文檔的實例代碼
小編最近在研究python,接觸到了爬蟲,本文給大家?guī)砹薖ython實現(xiàn)爬蟲從網(wǎng)絡上下載文檔的知識。下面小編把具體實例代碼分享到腳本之家平臺,感興趣的朋友參考下吧2018-06-06代碼總結Python2 和 Python3 字符串的區(qū)別
在本篇文章里小編給大家整理的是一篇關于Python2 和 Python3 字符串的區(qū)別以及實例代碼,需要的朋友們學習下。2020-01-01pytorch 狀態(tài)字典:state_dict使用詳解
今天小編就為大家分享一篇pytorch 狀態(tài)字典:state_dict使用詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-01-01python實現(xiàn)坦克大戰(zhàn)游戲 附詳細注釋
這篇文章主要為大家詳細介紹了python實現(xiàn)坦克大戰(zhàn)游戲,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-05-05