https://www.cnblogs.com/xueli/p/4970905.html
python除了unittest,还有一款更快捷的nose,nose可以说是对unittest的一种简化吧
但是他不需要unittest那种必须有固有的格式,他只需要文件,类名,方法名等含有test就可以
unittest是需要手动来写discover函数来遍历用例的
- Name my test modules/files starting with ‘test_’.
- Name my test functions starting with ‘test_’.
- Name my test classes starting with ‘Test’.
- Name my test methods starting with ‘test_’.
- Make sure all packages with test code have an ‘init.py’ file.
本文介绍了Python测试框架Nose相较于Unittest的优势。Nose简化了测试案例的编写过程,无需遵循严格的命名约定,只要包含'test'即可。与Unittest相比,Nose避免了手动编写discover函数来遍历测试案例。
2万+

被折叠的 条评论
为什么被折叠?



