AttributeError: 'module' object has no attribute 'TestCase'

I have file with unittest named: test.py My code: import unittest class Test(unittest.TestCase): def myTest(self): a = 1 self.assertEqual(a, 1) if __name__ == '__main__':