pytest 断言目前有几种方法:

    就不介绍了,这种见官方文档吧:https://docs.pytest.org/en/6.2.x/assert.html

 

2.第三方插件 py-assume

   这个官方文档:https://github.com/astraw38/pytest-assume

  个人感觉不好用

 

3. 第三方插件pytest-check

  官方文档:https://github.com/okken/pytest-check

  比第2个好用点

 

4. 其它方法

 比如借用nose.tool中有断言。不过需要装nose

但nose 1.3.7版本只支持python2 python3也可以用。但支持不好。

 

相关文章:

  • 2021-05-20
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-02-27
  • 2021-06-12
猜你喜欢
  • 2021-07-10
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-06-19
相关资源
相似解决方案