美文网首页
pytest测试框架使用

pytest测试框架使用

作者: 阿尼奥赛哟 | 来源:发表于2020-06-08 17:32 被阅读0次

1. 测试用例的编写

测试函数必须以test_开头,assert用来断言 比如:

class TestClass:

    def test_one(self):

         x="hello"

         assert "h" in x

2. 测试用例的执行

pytest xx.py

pytest-conftest:在所有用例执行之前如果要执行的统一操作(比如登录)

https://www.cnblogs.com/linuxchao/p/linuxchao-pytest-conftest.html

相关文章

网友评论

      本文标题:pytest测试框架使用

      本文链接:https://www.haomeiwen.com/subject/cdgrtktx.html