From e61b512983e7301fc146ed0d40cdf52440ae0e9b Mon Sep 17 00:00:00 2001 From: zy7y <13271962515@163.com> Date: Mon, 17 May 2021 10:06:32 +0800 Subject: [PATCH] =?UTF-8?q?update=20test/conftest.py.=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8=E6=95=B0=E6=8D=AE=E6=B8=85=E6=B4=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B3=A8=E9=87=8A=E4=BB=A3=E7=A0=81=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/conftest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/conftest.py b/test/conftest.py index 41c9eae..e46ae7b 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -28,7 +28,7 @@ def data_clearing(): DataClearing.close_client() -# 若不需要数据清洗功能,请把get_db()入参拿掉 +# 若不需要数据清洗功能,请把data_clearing去掉 @pytest.fixture(scope="session") def get_db(data_clearing): """关于其作用域请移步查看官方文档""" @@ -38,6 +38,15 @@ def get_db(data_clearing): finally: db.close() +# 不使用数据清洗 请把 下面代码解除注释 上面的get_db函数注释 +# @pytest.fixture(scope="session") +# def get_db(): +# """关于其作用域请移步查看官方文档""" +# try: +# db = DB() +# yield db +# finally: +# db.close() @pytest.fixture(params=ReadFile.read_testcase()) def cases(request):