loveshouhu
V2EX  ›  pytest

关于Python单元测试框架

  •  
  •   loveshouhu · Jan 8, 2014 · 10028 views
    This topic created in 4689 days ago, the information mentioned may be changed or developed.
    最近想了解点关于Python单元测试框架的东西。
    大家有推荐吗。

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

    PyUnit nose 什么的有推荐吗?
    12 replies  •  1970-01-01 08:00:00 +08:00
    hhrmatata
    hhrmatata
    Jan 8, 2014❤️1
    1
    你应该Google一下,就有答案了。
    polythene
    polythene
    Jan 8, 2014
    3
    LZ你就从了unittest吧
    pyKun
    pyKun
    Jan 8, 2014
    4
    fdsfsdfsdf3334
    fdsfsdfsdf3334
    Jan 8, 2014
    5
    这个能用来测试啥
    loveshouhu
    loveshouhu
    OP
    Jan 8, 2014
    6
    @polythene 雅蠛蝶。。。
    loveshouhu
    loveshouhu
    OP
    Jan 8, 2014
    7
    @fdsfsdfsdf3334 测试代码。 ==
    reorx
    reorx
    Jan 8, 2014❤️2
    9
    @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
    loveshouhu
    OP
    Jan 8, 2014
    10
    @reorx 多谢。
    loggerhead
    loggerhead
    Jan 9, 2014
    11
    补充一个:doctest
    1989922yan
    1989922yan
    Jan 20, 2014
    12
    doctest,简单好用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   925 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 21:52 · PVG 05:52 · LAX 13:52 · JFK 16:52
    ♥ Do have faith in what you're doing.