有时我们添加完@allure.feature会发现用例左侧爆红,代码无异常,但是执行却报找不到这个方法错误。
我们会发现执行程序时,collecting... 报错。
报错:ERROR: not found: D:\python\autoFuncTest2\test_cases\test_login2.py::TestLogin2::test_login2
(no name 'D:\\python\\autoFuncTest2\\test_cases\\test_login2.py::TestLogin2::test_login2' in any of [<Module test_login2.py>])
原因1:@allure.feature('登录模块')应该写在2的位置,却写在1位置
原因2:@allure.feature('登录模块')应该写在1的位置,却写在2位置