标签:hello pre 判断 __name__ 验证 方法 span test imp
结果断言
1)结果断言验证
2)数据库断言验证
一、几种常用的断言方法
import pytest # 判断xx为真 def test_1(): assert 1 def test_2(): a = True assert a #判断xx不为真 def test_3(): a = "Hello" b = "Hello world" assert a in b def test_4(): a = b = ‘Hello‘ assert a==b def test_5(): a = "Hello" b = "Hello world" assert a!=b if __name__=="__main__": pytest.main([‘pytest_assert.py‘])
标签:hello pre 判断 __name__ 验证 方法 span test imp
原文地址:https://www.cnblogs.com/caowenyue/p/13583316.html