国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

Python HTMLTestRunner庫安裝過程解析

瀏覽:103日期:2022-07-24 15:51:52

安裝 HTMLTestRunner 庫的方法非常簡單,直接 pip 就可以了

pip install html-testRunner

在 https://pypi.org/ 中可以直接搜索到,并且官方還提供了詳細(xì)的文檔,操作起來非常的簡單

官方示例代碼:

import HtmlTestRunnerimport unittestclass TestStringMethods(unittest.TestCase): def test_upper(self): self.assertEqual(’foo’.upper(), ’FOO’) def test_error(self): ''' This test should be marked as error one. ''' raise ValueError def test_fail(self): ''' This test should fail. ''' self.assertEqual(1, 2) @unittest.skip('This is a skipped test.') def test_skip(self): ''' This test should be skipped. ''' passif __name__ == ’__main__’: unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output=’example_dir’))

這是運(yùn)行后,生成的 HTML 網(wǎng)頁

Python HTMLTestRunner庫安裝過程解析

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 和政县| 荆州市| 广河县| 万源市| 神农架林区| 安龙县| 苍梧县| 北票市| 连平县| 宣化县| 东乡县| 宁远县| 洛隆县| 游戏| 富川| 宁明县| 元氏县| 德格县| 彭山县| 沧州市| 晋江市| 日土县| 乐都县| 仪陇县| 攀枝花市| 杂多县| 屯昌县| 富锦市| 南召县| 宣威市| 舞阳县| 阿尔山市| 普安县| 北票市| 闻喜县| 潮安县| 类乌齐县| 阿图什市| 湖北省| 东阿县| 大英县|