摘要:
data: name: itcast age: 13 import yaml with open("./hello.yaml", "r") as f: data = yaml.load(f) print(data) 阅读全文
摘要:
#跳过指定的测试函数 import pytest # class Test_ABC(object): # def test_a(self): # print("test-a在执行") # def test_b(self): # print("test-b在执行") # # @pytest.mark. 阅读全文
摘要:
import pytest #函数级别 #每个测试函数前都会执行一次 # @pytest.fixture() # def before(): # print("在函数前执行") # # def test_a(before): # print("test_a在执行") # # # def test_b 阅读全文
摘要:
import pytest #pip install pytest-ordering #pip install pytest-rerunfailures #修改函数的执行顺序 #都是负数,值越小越先执行 #0和负数,0先执行 #0>较小整数>较大整数>无标记>较小负数>较大负数 @pytest.ma 阅读全文
摘要:
[pytest] addopts = -s python_fils = test_*.py 阅读全文
摘要:
from appium import webdriver import pytest class Test_ABC(object): def setup_class(self): desired_caps = {} desired_caps['platformName'] = 'Android' d 阅读全文
摘要:
import pytest class Test_ABC(object): #函数级别的set_up和teardown使用,无论失败还是成功 #setup和teardown每个函数都会执行一次 # def setup(self): # print("setup_menthod") # def tea 阅读全文
摘要:
import pytest #定义的函数必须以test开头 def test_a(): print("test_a") assert 1 import pytest #定义的函数必须以test开头 def test_a(): print("test_a") assert 1 def test_b() 阅读全文