pycharm 单元测试运行错误
RuntimeWarning: Parent module ‘tests‘ not found while handling absolute import
import unittest
RuntimeWarning: Parent module ‘tests‘ not found while handling absolute import
import datetime as dt
Pycharm import RuntimeWarning after updating to 2016.2.
用老版本的utrunner.py替换新版本的utrunner.py
import sys
import imp
import os
import fnmatch
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
sys.path.insert(0, helpers_dir)
from tcunittest import TeamcityTestRunner
from nose_helper import TestLoader, ContextSuite
from pycharm_run_utils import import_system_module
from pycharm_run_utils import adjust_sys_path
from pycharm_run_utils import debug, getModuleName, PYTHON_VERSION_MAJOR
adjust_sys_path()
os = import_system_module("os")
re = import_system_module("re")
modules = {}
def loadSource(fileName):
baseName = os.path.basename(fileName)
moduleName = os.path.splitext(baseName)[0]
# for users wanted to run unittests under django
#because of django took advantage of mo