pytest中没有发现测试 ,空套件,返回代码为5
代码:mport openpyxl
import pytest
from page.env_elements import Elements
from logic.login_tp import Login
def get_excel():
case = openpyxl.load_workbook('C:/Users/57890/Desktop/demo1.xlsx')
sheet = case.active
vlaues = []
for row in sheet:
line = []
for cell in row:
line.append(cell.value)
vlaues.append(line)
print(vlaues)
return vlaues
class Login_test:
@pytest.mark.parametrize('username,password', get_excel())
def test_case01(self, username, password):
action = Login()
action.login_tpshop(username, password)
assert '安全退出' in action.get_text(Elements.SAFEQUIT_BUTTON)
if name == 'main':
pytest.main(['-s'])结果:进程已结束,退出代码为 5空套件
下个断点看下 debug一下
页:
[1]