开发工具¶
本章介绍的模块帮助您编写软件。例如, pydoc
模块接受模块并根据模块的内容生成文档。这个 doctest
和 unittest
模块包含用于编写单元测试的框架,这些测试自动执行代码并验证是否生成了预期的输出。 2to3 无法将python 2.x源代码转换为有效的python 3.x代码。
本章介绍的模块列表如下:
typing
---支持类型提示pydoc
---文档生成器和联机帮助系统- Python开发模式
- Python开发模式的效果
- 资源警告示例
- 错误的文件描述符错误示例
doctest
---测试交互式python示例unittest
——单元测试框架unittest.mock
---模拟对象库unittest.mock
---开始- 2to 3-自动python 2到3代码转换
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
---操作系统测试实用程序test.support.import_helper
---用于导入测试的实用程序test.support.warnings_helper
---警告测试实用程序