V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
loveshouhu
V2EX  ›  pytest

关于Python单元测试框架

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

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

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