I have noticed that when using Python's unittest.TestCase unit testing package, PyCharm's Unit Testing tool is able to recognize the tests when the files are named anything other than __init__.py
. However, when I name them __init__.py
, PyCharm doesn't pick them up. This is the error I get:
ImportError: '__init__' module incorrectly imported from 'C:\\Users\\morrij14\\AppData\\Roaming\\JetBrains\\PyCharm Community Edition 2017.1.2\\helpers\\pycharm'. Expected 'C:\\Users\\morrij14\\ivy\\Unit_Test3\\lib\\pt_hil\\utilities\\PT_HIL_Report_Utils\\html_utility\\tests'. Is this module globally installed?
I am guessing it has to be something with the PyCharm settings. Or maybe Unit Test files are not supposed to be named init.py