开发工具¶
本章中介绍的模块可帮助你编写软件。例如,pydoc 模块接受一个模块并根据该模块的内容来生成文档。 doctest 和 unittest 模块包含用于编写自动执行代码并验证是否产生预期的输出的单元测试的框架。
本章中描述的模块列表是:
typing--- 对类型提示的支持pydoc--- 文档生成器和在线帮助系统- Python 开发模式
doctest--- 测试交互式的 Python 示例unittest--- 单元测试框架unittest.mock--- 模拟对象库unittest.mock--- 新手入门test--- Python 回归测试包test.support--- Utilities for the Python test suitetest.support.socket_helper--- Utilities for socket teststest.support.script_helper--- Utilities for the Python execution teststest.support.bytecode_helper--- Support tools for testing correct bytecode generationtest.support.threading_helper--- Utilities for threading teststest.support.os_helper--- Utilities for os teststest.support.import_helper--- 用于导入测试的工具Utilities for import teststest.support.warnings_helper--- 用于警告测试的工具Utilities for warnings tests