1. 程式人生 > 遊戲 >換個角度看經典 《黑暗之魂3》等距視角視訊欣賞

換個角度看經典 《黑暗之魂3》等距視角視訊欣賞

day1

pytest外掛:可以實現測試用例的跳過和重新執行失敗用例
pytest-html:生成HTML格式的自動化測試報告
pytest-xdist:測試用例分散式執行,多cpu分發
pytest-ordering:用於改變測試用例的執行順序
pytest-rerunfailures:用於失敗用例重跑
allure-pytest:用於生成測試報告
安裝:pip install -r test.txt,將外掛存到test.txt中,批量安裝

基礎應用:
1.檔名必須以test_開頭或_test結尾
2.測試類必須以Test開頭,不能用ini方法
3.測試方法必須以test開頭

執行:
1.pytest.main([-s,test.py]),pytest.main([-s,/test]),pytest.main([-s,test.py::test])執行函式 -s:顯示測試方法裡面列印的資訊 -v:顯示詳細資訊 -n:支援多執行緒或者分散式執行 pytest -vs test.py -n 2 ------兩個執行緒 pytest.main(["-s","test.py","-n=2"]) --reruns:重跑失敗用例 pytest -vs test.py --reruns 2 -x:只要有用例失敗,測試停止 -maxfail 2:只要有兩個,測試停止 -k:指定字串執行用例 指定用例順序 加裝飾器@pytest.mark.run(order
=1) 通過讀取ini配置檔案執行 pytestini檔案,編碼為ANSI [pytest] addopts = -vs --html reprot.html testpaths = ./test python_files = test_*.py python_classes = Test* python_functions = test 分組執行用例 加裝飾器@pytest.mark.smoke markers = smoke products pytest -vs -m "smoke" 跳過測試用例 @pytest.mark.skip(reason="")

day2