python自动化用例


import pytest
@pytest.fixture(scope='function')
def open():
print('open')
yield
print('teardown')
def test_num(open):
assert 1 != 2
def test_num_2(open):
assert 1 == 1
def test_num_3(open):
assert 2 == 2


import pytest
@pytest.fixture(scope='function')
def open():
print('open')
yield
print('teardown')
def test_num(open):
assert 1 != 2
def test_num_2(open):
assert 1 == 1
def test_num_3(open):
assert 2 == 2