python - 如何正确使用单元测试(任何语言)

标签 python unit-testing testing

我以前从未真正编写过单元测试(或测试,就此而言,真的)。我倾向于在编写哪怕是最小的代码来检查错误之后就着迷地运行/编译。我最近一直在阅读单元测试,我很好奇如何最好地使用/实现它们。我最近的主要语言是 Python,但我认为这是一个与语言无关的问题。有没有人对如何正确执行此操作有一些提示(或良好的阅读)?

谢谢!

最佳答案

我会建议 Chapter 13Dive Into Python .

关于python - 如何正确使用单元测试(任何语言),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4071991/

相关文章:

Python-Camelot 提取空表

c# - 系统.BadImageFormatException : Could not load file or assembly 'x_Accessor,...' This assembly is built by a runtime newer

java - 此方法中的故障或错误

python - 如何将字符串写入远程机器上的文件?

python - 使用 pymongo 在 MongoDB 中创建具有父子层次结构的数据库

python - 在 python 列表中搜索元素

visual-studio-2010 - UnitTest 在 Visual Studio 2010 中一直挂起

c# - 单元测试未在 TFS 版本中运行 Release|x64 平台

unit-testing - 设计实践 : code to create before deletion in deletion test case?

Angular 6 单元测试 : I want to stub a declared property for my test