from.importutilimportunittestclassAPITest(unittest.TestCase):"""Test API-specific details for __import__ (e.g. raising the right exception when passing in an int for the module name)."""deftest_name_requires_rparition(self):# Raise TypeError if a non-string is passed in for the module name.withself.assertRaises(TypeError):util.import_(42)deftest_main():fromtest.supportimportrun_unittestrun_unittest(APITest)if__name__=='__main__':test_main()