在pycharm远程链接linux服务器进行代码部署时出现该问题
==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/_pytest/config/__init__.py:570: in _importconftest
mod = import_path(conftestpath, mode=importmode)
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/_pytest/pathlib.py:544: in import_path
raise ImportPathMismatchError(module_name, module_file, path)
E _pytest.pathlib.ImportPathMismatchError: ('numpy.conftest', '/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/numpy/conftest.py', PosixPath('/root/SW/L3/lib/3rd/python/python3.9/site-packages/numpy/conftest.py'))
=========================== short test summary info ============================
ERROR - _pytest.pathlib.ImportPathMismatchError: ('numpy.conftest', '/opt/bu...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 7.92s ===============================
如何解决呢?
问题已解决,使用pytest.ini 忽略掉那个路径即可,但是这个pytest.ini要放到工作目录那里才生效,放到项目的根目录是不会生效的,不知道是不是映射的问题,这15我随机给一个含有这个方法的回答了。