Allen Lin Allen Lin - 26 days ago 18
Python Question

Pycharm import RuntimeWarning after updating to 2016.2

After updating to new version 2016.2, I am getting

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


'tests' is a package inside my main app package, and I receive these warnings when I try to execute unit tests inside this folder. This issue only came up after updating to 2016.2. Besides the warnings, the remaining code works fine.

Edit: This is a known issue - https://youtrack.jetbrains.com/issue/PY-20171. They are suggesting to replace utrunner.py in PyCharm installation folder.

Answer

This is a known issue with the 2016.2 release. Progress can be followed on the JetBrains website here. According to this page it's due to be fixed in the 2016.3 release but you can follow the utrunner.py workaround that others have mentioned in the meantime (I downloaded the 2016.1 release and copied the file over from there).

Comments