pytest

Specifying tests / selecting tests
Several test run options:

  • pytest test_mod.py # run tests in module
  • pytest somepath # run all tests below somepath
  • pytest -k stringexpr # only run tests with names that match the "string expression", e.g. "MyClass and not method" will select TestMyClass.test_something but not TestMyClass.test_method_simple
  • pytest test_mod.py::test_func # only run tests that match the "node ID", e.g. "test_mod.py::test_func" will select only test_func in test_mod.py
  • pytest test_mod.py::TestClass::test_method # run a single method in a single class
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • BreezeNicole阅读 161评论 0 0
  • 查理~芒格,巴菲特的老师,真正的价值投资高手。 “从来没有国家因为贸易而衰落” “不把事管好,就要被事管” “...
    AK47_10年坚持阅读 613评论 0 0
  • Hi,大家好! 欢迎大家访问我的网页! 百度新闻
    seanhuxihong阅读 125评论 0 0
  • 一经别年 我留在你的转身处 忘穿你迟迟不肯回望却也不能再相守,这样也就罢了 ,毕竟一辈子浅浅淡淡那么短 ,正如你所...
    简森y阅读 613评论 0 7
  • 分手 两周半 他已 另觅了新欢 你却还在 诅咒的阶段 别担心 宝贝 死心塌地 谈恋爱 破锅 都有自己专属的破锅盖儿...
    禅林咖啡的瑜鸿阅读 380评论 0 0