Leozhanggg / ApiTesting

基于Python+Pytest+Requests+Allure+Yaml+Json实现全链路接口自动化测试
236 stars 71 forks source link

运行 pytest 报错 #1

Closed matthewxuda closed 2 years ago

matthewxuda commented 3 years ago

==================================================================================== ERRORS ==================================================================================== _ ERROR collecting PyDemo/testcase/perRelated/test_addAudltCard.py ___ ImportError while importing test module '/Users/xianxian/Desktop/work/ApiTesting/PyDemo/testcase/perRelated/test_addAudltCard.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: PyDemo/testcase/perRelated/test_addAudltCard.py:9: in from comm.utils.readYaml import read_yamldata E ModuleNotFoundError: No module named 'comm' ERROR collecting PyDemo/testcase/register/test_addOrUpCurBact.py _ ImportError while importing test module '/Users/xianxian/Desktop/work/ApiTesting/PyDemo/testcase/register/test_addOrUpCurBact.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: PyDemo/testcase/register/test_addOrUpCurBact.py:9: in from comm.utils.readYaml import read_yaml_data E ModuleNotFoundError: No module named 'comm' ___ ERROR collecting PyDemo/testcase/register/test_findParam.py __ ImportError while importing test module '/Users/xianxian/Desktop/work/ApiTesting/PyDemo/testcase/register/test_findParam.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: PyDemo/testcase/register/test_findParam.py:9: in from comm.utils.readYaml import read_yaml_data E ModuleNotFoundError: No module named 'comm' ____ ERROR collecting PyDemo/testcase/register/testgetAdultCurbactList.py ____ ImportError while importing test module '/Users/xianxian/Desktop/work/ApiTesting/PyDemo/testcase/register/test_getAdultCurbactList.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: PyDemo/testcase/register/test_getAdultCurbactList.py:9: in from comm.utils.readYaml import read_yaml_data E ModuleNotFoundError: No module named 'comm' _ ERROR collecting PyDemo/testcase/register/test_initCanSelInfo.py ___ ImportError while importing test module '/Users/xianxian/Desktop/work/ApiTesting/PyDemo/testcase/register/test_initCanSelInfo.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: PyDemo/testcase/register/test_initCanSelInfo.py:9: in from comm.utils.readYaml import read_yamldata E ModuleNotFoundError: No module named 'comm' ERROR collecting config/test_template.py ___ ImportError while importing test module '/Users/xianxian/Desktop/work/ApiTesting/config/test_template.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: config/test_template.py:10: in from comm.unit.initializePremise import init_premise comm/unit/initializePremise.py:12: in from comm.unit import apiSend, readRelevance, replaceRelevance comm/unit/apiSend.py:10: in from comm.unit import apiMethod comm/unit/apiMethod.py:12: in from requests_toolbelt import MultipartEncoder E ModuleNotFoundError: No module named 'requests_toolbelt' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! =============================================================================== 6 error in 0.57s ====================

matthewxuda commented 3 years ago
屏幕快照 2021-10-19 19 31 48

报错了

Leozhanggg commented 3 years ago

你用的是哪个版本?貌似是之前的bug,把test_template.py后缀替换错了,所以找不到,可以更新一下代码