关于Python单元测试框架

2014 年 1 月 8 日
 loveshouhu
最近想了解点关于Python单元测试框架的东西。
大家有推荐吗。

百度了一下,没发现特别有分析性的文字。

PyUnit nose 什么的有推荐吗?
9724 次点击
所在节点    pytest
12 条回复
hhrmatata
2014 年 1 月 8 日
你应该Google一下,就有答案了。
suckli
2014 年 1 月 8 日
polythene
2014 年 1 月 8 日
LZ你就从了unittest吧
pyKun
2014 年 1 月 8 日
fdsfsdfsdf3334
2014 年 1 月 8 日
这个能用来测试啥
loveshouhu
2014 年 1 月 8 日
@polythene 雅蠛蝶。。。
loveshouhu
2014 年 1 月 8 日
@fdsfsdfsdf3334 测试代码。 ==
wenbinwu
2014 年 1 月 8 日
reorx
2014 年 1 月 8 日
@wenbinwu +1 pytest 的文档非常赞,除了 pytest 库本身的使用,也讲了很多非常好的单元测试思想和最佳实践。虽然我主要用 nose,但读过之后还是觉得受益匪浅。

特别推荐下这一部分,关于如何在项目中组织测试文件的位置: http://pytest.org/latest/goodpractises.html#choosing-a-test-layout-import-rules

其他关于 Python 测试的资源可以看下我的 pinboard 里的收藏: https://pinboard.in/u:reorx/t:testing/t:python/
loveshouhu
2014 年 1 月 8 日
@reorx 多谢。
loggerhead
2014 年 1 月 9 日
补充一个:doctest
1989922yan
2014 年 1 月 20 日
doctest,简单好用

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/96126

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX