run_main.py中调用HandExcel.get_rows(),提示缺少参数self
来源:7-5 接口自动化测试框架设计开发之模型搭建
刘瑞丰
2021-06-02
from Util.hadle_excel import HandExcel
class run_main:
def run_case(self):
rows = HandExcel.get_rows()
for i in range(rows):
data = HandExcel.get_rows_value(i+2)
print (data)
if name == ‘main’:
run = run_main()
run.run_case()
C:\Programs\Python\Python38\python.exe E:/zgq_workspace/autointerface_zgq/automation-zgq/venv/Run/run_main.py
Traceback (most recent call last):
File “E:/zgq_workspace/autointerface_zgq/automation-zgq/venv/Run/run_main.py”, line 12, in
run.run_case()
File “E:/zgq_workspace/autointerface_zgq/automation-zgq/venv/Run/run_main.py”, line 5, in run_case
rows = HandExcel.get_rows()
TypeError: get_rows() missing 1 required positional argument: ‘self’
Process finished with exit code 1
1回答
-
Mushishi
2021-06-02
HandExcel 你这个是类名字还是对象名字?
042021-06-06
相似问题