The modules described in this chapter help you write software. For example, the
pydoc
module takes a module and generates documentation based on the module’s contents. The
doctest
and
unittest
modules contains frameworks for writing unit tests that automatically exercise code and verify that the expected output is produced.
2to3
can translate Python 2.x source code into valid Python 3.x code.
在本章中描述的模块列表:
typing
— 支持类型提示
pydoc
— 文档编制生成器和在线帮助系统
doctest
— 测试交互 Python 范例
unittest
— 单元测试框架
unittest.mock
— 仿造对象库
unittest.mock
— 快速入门
test
— 用于 Python 的回归测试包
test.support
— 用于 Python 测试套件的实用程序