開發工具¶
本章描述的模組幫助您編寫軟體。例如,pydoc 模組接受一個模組並根據其內容生成文件。doctest 和 unittest 模組包含用於編寫單元測試的框架,這些測試可自動執行程式碼並驗證是否產生預期輸出。
本章描述的模組列表是
typing--- 對型別提示的支援pydoc--- 文件生成器和線上幫助系統- Python 開發模式
doctest--- 測試互動式 Python 示例unittest--- 單元測試框架unittest.mock--- mock 物件庫unittest.mock— 入門test— Python 的迴歸測試包test.support— Python 測試套件的工具test.support.socket_helper— 套接字測試工具test.support.script_helper— Python 執行測試工具test.support.bytecode_helper— 用於測試正確位元組碼生成的支援工具test.support.threading_helper— 執行緒測試工具test.support.os_helper— os 模組測試工具test.support.import_helper— 匯入測試工具test.support.warnings_helper— 警告測試工具