摘要:
l1 = [10086, 10010, 110, 120]code = ["xxx","ppppp","oooo","wwww"]@pytest.mark.parametrize("mobile,code",zip(l1,code))def test_case(mobile,code): print 阅读全文
摘要:
pytest.ini [pytest]addopts = -s -vtestpaths = ./scriptspython_files = test_case.pypython_classes = Test*python_functions = test_*xfail_strict = true t 阅读全文
摘要:
import pytestdef test_case_01(): assert 1#无条件跳过类:@pytest.mark.skip()class TestCase(object): """加装饰器跳过测试用例""" @pytest.mark.skip(condition=True, reason= 阅读全文
摘要:
目录结构: pytest.ini [pytest]addopts = -s -vtestpaths = ./scriptspython_files = test_*.pypython_classes = Test*python_functions = test_* test_case.py def 阅读全文
摘要:
import pytestimport requestsclass TestCase(object): def test_case_01(self): """再执行三""" assert 1 def test_case_02(self): """再执行六""" assert {"title":"v2 阅读全文
摘要:
阅读全文
摘要:
import pytestimport requestsclass TestCase(object): def test_case_01(self): assert 1 def test_case_02(self): assert {"title":"v2ex"} != {"title":"V2EX 阅读全文
摘要:
import pytestimport requests#定义预期结果:expect = {"title":"V2EX"}class TestCase(object): def test_case_01(self): assert 1 def test_case_02(self): assert { 阅读全文
摘要:
import pytestimport requestsimport sys#建立数据库连接:def setup_function(): print("建立数据库连接成功...")def test_case_01(): assert 1#断开数据库连接:def teardown_function() 阅读全文
摘要:
import pytestimport requests#定义预期结果:expect = {"title":"V2EX"}def test_case_01(): response = requests.get(url='https://www.v2ex.com/api/site/info.json' 阅读全文