pycharm右键执行可以正常找到读取文件位置,pytest命令行执行报错找不到文件位置

久曲健 / 2024-01-13 / 原文

self.fileName = os.path.join(os.path.dirname(__file__), '目录', '文件')