Pycharm 升级到 2016.3 以后运行 unittest 报错。
报错信息:
RuntimeWarning: Parent module '...' not found while handling absolute import
import sys
RuntimeWarning: Parent module '...' not found while handling absolute import
import time
RuntimeWarning: Parent module '...' not found while handling absolute import
import unittest
这是一个已知问题,从2016.2版本就存在,目前为止还没解决。BUG
目前的解决办法是使用旧的utrunner.py替换新的utrunner.py
解决办法:
STEP1. 打开 pycharm 目录
open /Applications/PyCharm\ CE.app/Contents/helpers/pycharm
STEP2. 下载旧的utrunner.py
STEP3. 用旧的utrunner.py替换pycharm目录下的utrunner.py
然后问题解决。