摘要:
# pandas默认依赖xlrd库,故先安装xlrdpip install xlrd# 安装Pandaspip install PandasPandas 语法 复制代码import Pandas as pd# 首先初始化,engine默认是xlrds = pd.ExcelFile(path_or_b 阅读全文
摘要:
def read_data_from_excel(excel_file,sheet_name): return_value=[] #判断文件是否存在 if not os.path.exists(excel_file): raise ValueError("File not exists") #打开指 阅读全文
摘要:
pytest.fixtures 的语法如下: fixture(scope="function", params=None, autouse=False, ids=None, name=None)其中,fixture 的 5 个参数如下。 scope:用于控制 fixture 的作用范 这个参数有以下 阅读全文
摘要:
使用 conftest.py 来共享 fixture 通过上面的学习,我们掌握了如何在同一个文件中进行 fixture 的定义、共享和使用。但在日常工作测试中,我们常常需要在全局范围内使用同一个测试前置操作。例如,测试开始时首先进行登录操作,接着连接数据库。 这种情况下,我们就需要使用 confte 阅读全文