收藏清單: python測試框架最全資源彙總

原文鏈接:http://www.cnblogs.com/Detector/p/8477276.html

xUnit frameworks 單元測試框架

  • frameworks 框架
    • unittest - python自帶的單元測試庫,開箱即用
    • unittest2 - 加強版的單元測試框架,適用於Python 2.7以及後續版本
    • pytest - 成熟且功能強大的單元測試框架
    • plugincompat - pytest的執行及兼容性插件
    • nosetests - 讓python測試更容易一點
    • slash - python實現的單元測試框架
  • extensions 擴展
    • proboscis - 仿TestNG擴展了unittest模塊以及Nose的功能
    • grail - 可以讓你一步一步編寫測試用例的庫
    • testify - 單元測試框架,提供了加強型fixture,用例切割並行運行,testrunner高亮及詳盡的log和report功能
    • trial - unittest模塊的擴展,提供了命令行的testrunner工具以及代碼覆蓋率的整合,跟nose差不多
    • subunit - 提供了unittest在另一個進程執行用例並彙總測試數據的能力
    • testresources - 提供了多用例間管理測試數據的機制,兼容unittest
    • testtools - 爲Twisted和Bazaar提供的unittest擴展
    • Sancho - 運行用例,併爲失敗的用例提供報告,但僅限於此
    • zope.testing - testrunner,提供了不錯的debuge能力,並且集成了代碼覆蓋率。可以跟zope項目使用,也可以用在非zope項目上
    • pythoscope - 自動或半自動爲遺留的python系統創建測試用例的工具
    • testlib - 更強大的unittest,更多的斷言,支持module級的setup/teardown,skip test等...
    • dutest - An object oriented interface to retrieve unittest test cases out of doctests. Hides initialization from doctests by allowing setUp and tearDown for each interactive example. Allows control over all the options provided by doctest. Specialized classes allow selective test discovery across a package hierarchy.
    • green - Green是一個簡潔多彩的testrunner,跟nose很像
    • ddt - 讓unittest 支持 Data-Driven
    • pytractor Selenium python bindings的擴展. 目的是讓angular項目的測試更簡單

TDD  ATDD  BDD 測試框架

  • BDD
  • Assertions 斷言
    • pyshould - 基於pyhamcrest的Should style斷言
    • pyhamcrest - python版的Hamcrest matchers
    • sure -python實現的測試庫,提供了強大靈活的斷言
    • assertpy - 巨簡單的python單元測試斷言庫,提供了優雅流利的API. 支持Python 2 和 3.
  • Mocking
    • mock - python實現的Mocking和Patching庫
    • Ludibrio - 用python實現的優雅的test doubles框架(mocks, stubs, spy, and dummies).
    • responses - mock請求的 Python測試工具庫
    • doublex - 強大的 test doubles 框架
    • freezegun - 通過mocking datetime模塊實現時光穿梭
    • httpretty - HTTP請求的mock工具
    • httmock - requests的mock工具,支持Python 2.6+ and 3.2+.
    • pretenders - 測試用的fake server
    • mock-server - 簡單的mock sever,支持REST and XML-RPC API,還有基於tornado的管理界面
    • VCR.py - 自動 mock HTTP 交互 讓測試更簡單快速
發佈了59 篇原創文章 · 獲贊 4 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章