import pytest
@pytest.fixture(scope="session", autouse=True) # 只在类 前/后自动执行, autouse
def exec_db_sql():
print("执行SQL...") # 前置
yield # 后置
print("关闭数据库")
class Test_Run():
def test1(self):
print("测试1.....")
def test2(self):
print("测试2.....")
def test3(self):
print("测试3.....")