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
這里只講前三個(gè)常用的
generate 命令行參數(shù)
作用
生成 allure 的html 報(bào)告
語法格式
generate [options] allure 結(jié)果目錄
注:allure 結(jié)果目錄就是運(yùn)行 pytest 命令,--alluredir 跟的那個(gè)目錄
pytest -sq --alluredir= ./allure
命令選項(xiàng)
主要就是用 -c、-o 兩個(gè)參數(shù)
open 命令行參數(shù)
作用
打開生成的 allure 報(bào)告,就是打開 generate 命令生成的報(bào)告
語法格式
open [options] allure報(bào)告目錄
注:allure 報(bào)告目錄就是運(yùn)行 allure generate 命令,-o 跟的那個(gè)目錄
allure generate -o ./allure-report
命令選項(xiàng)
serve 命令行參數(shù)
作用
打開 allure 報(bào)告
語法格式
serve [options] allure 結(jié)果目錄
注:allure 結(jié)果目錄就是運(yùn)行 pytest 命令,--alluredir 跟的那個(gè)目錄
pytest -sq --alluredir= ./allure
命令選項(xiàng)
瀏覽器打開 allure 報(bào)告的兩種方式
allure serve
標(biāo)準(zhǔn)寫法
# 執(zhí)行 pytest,指定 allure 結(jié)果目錄 pytest -sq --alluredir=./allure # 打開 allure 報(bào)告 allure serve ./allure
allure generate + allure open
標(biāo)準(zhǔn)寫法
# 執(zhí)行 pytest,指定 allure 結(jié)果目錄 pytest -sq --alluredir=./allure # 生成 allure 的 html 報(bào)告 allure generate -c -o ./allure-report ./allure # 打開 allure 報(bào)告 allure open ./allure-report
當(dāng)然不寫 -o 也可以
看看 allure-report 的目錄結(jié)構(gòu)
- 這種方式的目錄會(huì)好看很多,不只是一堆 json 文件
- 而且直接打開 index.html 也是能看到 allure 報(bào)告的
到此這篇關(guān)于Pytest allure 命令行參數(shù)的使用的文章就介紹到這了,更多相關(guān)Pytest allure 命令行參數(shù)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
caffe的python接口繪制loss和accuracy曲線
這篇文章主要為大家介紹了caffe的python接口繪制loss和accuracy曲線示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-06-06python3中的eval和exec的區(qū)別與聯(lián)系
這篇文章主要介紹了python3中的eval和exec的區(qū)別與聯(lián)系,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-10-1010招!看骨灰級(jí)Pythoner玩轉(zhuǎn)Python的方法
這篇文章主要介紹了10招!看骨灰級(jí)Pythoner如何玩轉(zhuǎn)Python,需要的朋友可以參考下2019-04-04Python求均值,方差,標(biāo)準(zhǔn)差的實(shí)例
今天小編就為大家分享一篇Python求均值,方差,標(biāo)準(zhǔn)差的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2019-06-06Python實(shí)現(xiàn)爬蟲從網(wǎng)絡(luò)上下載文檔的實(shí)例代碼
小編最近在研究python,接觸到了爬蟲,本文給大家?guī)砹薖ython實(shí)現(xiàn)爬蟲從網(wǎng)絡(luò)上下載文檔的知識(shí)。下面小編把具體實(shí)例代碼分享到腳本之家平臺(tái),感興趣的朋友參考下吧2018-06-06代碼總結(jié)Python2 和 Python3 字符串的區(qū)別
在本篇文章里小編給大家整理的是一篇關(guān)于Python2 和 Python3 字符串的區(qū)別以及實(shí)例代碼,需要的朋友們學(xué)習(xí)下。2020-01-01pytorch 狀態(tài)字典:state_dict使用詳解
今天小編就為大家分享一篇pytorch 狀態(tài)字典:state_dict使用詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-01-01Django實(shí)現(xiàn)內(nèi)容緩存實(shí)例方法
在本篇文章里小編給大家整理了關(guān)于Django實(shí)現(xiàn)內(nèi)容緩存實(shí)例方法,有需要的朋友們可以跟著學(xué)習(xí)下。2020-06-06python實(shí)現(xiàn)坦克大戰(zhàn)游戲 附詳細(xì)注釋
這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)坦克大戰(zhàn)游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-05-05