pytest (一) fixture 简单使用
import pytest
# fixture默认参数function
@pytest.fixture()
def begin():
print('执行 test_a')
# 参数传入 begin
def test_b(begin):
print('执行 test_b')
执行 begin
执行 test_b
import pytest
# fixture默认参数function
@pytest.fixture()
def begin():
print('执行 test_a')
# 参数传入 begin
def test_b(begin):
print('执行 test_b')
执行 begin
执行 test_b