This commit is contained in:
Albert 2024-07-07 23:26:38 +08:00
parent 299dd378ae
commit ade83be71f
2 changed files with 14 additions and 13 deletions

View File

@ -104,15 +104,15 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
# send_weixin(content=content)
@pytest.fixture(scope='session', autouse=True)
def teardown_class():
"""
后置处理器session全局比如测试之后的数据清理就不会对系统造成影响也不会产生脏数据
@return:
"""
connect = MysqlUtil()
yield
sql = "select * from member where mobile_phone='18326074762'"
res = connect.get_fetchone(sql)
info_log(f"接口自动化测试垃圾数据处理结果为:{res}")
allure.attach('处理测试数据', 'fixture后置处理', allure.attachment_type.TEXT)
# @pytest.fixture(scope='session', autouse=True)
# def teardown_class():
# """
# 后置处理器session全局。比如测试之后的数据清理就不会对系统造成影响也不会产生脏数据。
# @return:
# """
# connect = MysqlUtil()
# yield
# sql = "select * from member where mobile_phone='18326074762'"
# res = connect.get_fetchone(sql)
# info_log(f"接口自动化测试垃圾数据处理结果为:{res}")
# allure.attach('处理测试数据', 'fixture后置处理', allure.attachment_type.TEXT)

View File

@ -10,7 +10,8 @@ rsa
Flask
PyMySQL
yagmail
urllib3
urllib3==1.26.18
charset_normalizer==3.2.0
Faker
gevent
pytest-tmreport