亚洲精品久久久久久第一页-人妻少妇精彩视品一区二区三区-91国产自拍免费视频-免费一级a在线播放视频正片-少妇天天日天天射天天爽-国产大屁股喷水视频在线观看-操美女骚穴抽插性爱视频-亚洲 欧美 中文字幕 丝袜-成人免费无码片在线观看

html隨機(jī)選數(shù)代碼介紹 html隨機(jī)數(shù)生成器( 四 )


[dechin@dechin-manjaro pytest]$ python3 -m pip install pytest-htmlCollecting pytest-htmlDownloading pytest_html-3.1.1-py3-none-any.whl (14 kB)Collecting pytest-metadataDownloading pytest_metadata-1.11.0-py2.py3-none-any.whl (10 kB)Requirement already satisfied: pytest!=6.0.0,>=5.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest-html) (6.2.1)Requirement already satisfied: attrs>=19.2.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest!=6.0.0,>=5.0->pytest-html) (20.3.0)Requirement already satisfied: py>=1.8.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest!=6.0.0,>=5.0->pytest-html) (1.9.0)Requirement already satisfied: toml in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest!=6.0.0,>=5.0->pytest-html) (0.10.1)Requirement already satisfied: packaging in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest!=6.0.0,>=5.0->pytest-html) (20.4)Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest!=6.0.0,>=5.0->pytest-html) (0.13.1)Requirement already satisfied: iniconfig in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest!=6.0.0,>=5.0->pytest-html) (1.1.1)Requirement already satisfied: six in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->pytest!=6.0.0,>=5.0->pytest-html) (1.15.0)Requirement already satisfied: pyparsing>=2.0.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->pytest!=6.0.0,>=5.0->pytest-html) (2.4.7)Installing collected packages: pytest-metadata, pytest-htmlSuccessfully installed pytest-html-3.1.1 pytest-metadata-1.11.0安裝成功后,執(zhí)行如下指令,可以在當(dāng)前目錄下生成一個(gè)指定文件名的html文件,如下圖所示,就比較全面且美觀的展示了測(cè)試中的信息:
[dechin@dechin-manjaro pytest]$ py.test --html=pytest_report.html=========================================== test session starts ============================================platform linux -- Python 3.8.5, pytest-6.2.2, py-1.9.0, pluggy-0.13.1rootdir: /home/dechin/projects/2021-python/pytest, configfile: pytest.iniplugins: cov-2.11.1, metadata-1.11.0, html-3.1.1collected 1 itemtest_random_number.py .[100%]--------- generated html file: file:///home/dechin/projects/2021-python/pytest/pytest_report.html ----------============================================ 1 passed in 0.51s =============================================不過在問題數(shù)量并不是很多的情況下,直接看命令行輸出也是比較方便的 。
pytest覆蓋率測(cè)試在一個(gè)python倉(cāng)庫(kù)中我們有可能有非常多的函數(shù)、類和文件等,為了保障結(jié)果的準(zhǔn)確性,我們需要能夠給出一個(gè)可信的覆蓋率測(cè)試的結(jié)論,只有當(dāng)覆蓋率達(dá)到100%時(shí),我們才能認(rèn)為測(cè)試工作已經(jīng)比較全面的考慮 。當(dāng)然,覆蓋率100%的測(cè)試,其實(shí)并不能保障100%的不出問題,這就是另外的話題了 。首先我們又需要補(bǔ)充安裝一個(gè)組件pytest-cov:
[dechin@dechin-manjaro pytest]$ python3 -m pip install pytest-covCollecting pytest-covDownloading pytest_cov-2.11.1-py2.py3-none-any.whl (20 kB)Collecting coverage>=5.2.1Downloading coverage-5.4-cp38-cp38-manylinux2010_x86_64.whl (245 kB)|████████████████████████████████| 245 kB 15 kB/s Requirement already satisfied: pytest>=4.6 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest-cov) (6.2.1)Requirement already satisfied: attrs>=19.2.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest>=4.6->pytest-cov) (20.3.0)Requirement already satisfied: packaging in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest>=4.6->pytest-cov) (20.4)Requirement already satisfied: iniconfig in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest>=4.6->pytest-cov) (1.1.1)Requirement already satisfied: toml in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest>=4.6->pytest-cov) (0.10.1)Requirement already satisfied: py>=1.8.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest>=4.6->pytest-cov) (1.9.0)Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in /home/dechin/anaconda3/lib/python3.8/site-packages (from pytest>=4.6->pytest-cov) (0.13.1)Requirement already satisfied: six in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->pytest>=4.6->pytest-cov) (1.15.0)Requirement already satisfied: pyparsing>=2.0.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->pytest>=4.6->pytest-cov) (2.4.7)Installing collected packages: coverage, pytest-covSuccessfully installed coverage-5.4 pytest-cov-2.11.1然后在當(dāng)前目錄下執(zhí)行以下指令:


以上關(guān)于本文的內(nèi)容,僅作參考!溫馨提示:如遇健康、疾病相關(guān)的問題,請(qǐng)您及時(shí)就醫(yī)或請(qǐng)專業(yè)人士給予相關(guān)指導(dǎo)!

「愛刨根生活網(wǎng)」www.malaban59.cn小編還為您精選了以下內(nèi)容,希望對(duì)您有所幫助: