在命令行执行:pytest xx.py ,提示找不到另一个文件yy里的包

解决办法:在xx.py导包前加上以下两句:

import sys

from os.path import dirname

sys.path.append(dirname(dirname(__file__)))