python

Python pytest 紀錄單元測試時間

最近看了一篇文章 Timing Tests in Python for Fun and Profit ,這篇文章蠻值得一讀的,主要是陳述如何透過紀錄測試案例(test case)的執行時間找到需要改善測試速度的測試案例(其實也可能發現執行效率不好的程式)。

不過個人較常使用的是 pytest ,所以就另外花了些時間看如何在 pytest 做到一樣的事情。

Posted on  Nov 20, 2016  in  Python 模組/套件推薦  by  Amo Chen  ‐ 2 min read

Python unittest 模組教學 part 1

本文是 Python unittest 模組的教學: Python unittest 模組教學 Part 1 Python unittest 模組教學 Part 2 本篇談談 Python 的 unittest 模組。 顧名思義, unittest 就是專門做單元測試(unit test)的模組。 從 Python 2.1 開

Last updated on  Mar 20, 2023  in  Python 程式設計 - 中階  by  Amo Chen  ‐ 5 min read