[Python] 用 Pytest 來做 Unit Test

Wis
Drunk-House :”P
Published in
6 min readJul 19, 2019

--

什麼是Pytest?

Pytest是一款強大的Python測試工具,支援平行化測試,使用上簡單方便,適合用在各種不同類型的軟體架構,也適用於RD、QA或獨立測試小組,也適合正要導入TDD的公司。

Python Developer Survey 2018 Results 被選為最受歡迎的Testing Framework。(不多說了自己看吧 XD)

Best Test Frameworks from python-developers-survey-2018

來寫測試吧!

  • 先用pip安裝pytest:
pip install pytest
  • 測試專案 - Folder Structure [Link]

--

--

Wis
Drunk-House :”P

The life of Software Engineer. 陽光、空氣、啤酒🍻、水,咖啡☕️、柯基 & 柴犬 🐕。