importasttry:importunittest2asunittestexceptImportError:importunittestimporttest_code_genimportastunparseclassMyTests(test_code_gen.CodegenTestCase):to_source=staticmethod(astunparse.unparse)# Just see if it'll do anything good at allassertSrcRoundtrips=test_code_gen.CodegenTestCase.assertAstRoundtrips# Don't look for exact comparison; see if ASTs matchdefassertSrcEqual(self,src1,src2):self.assertAstEqual(ast.parse(src1),ast.parse(src2))if__name__=='__main__':unittest.main()