Source

rope_py3k / ropetest / refactor / patchedasttest.py

Diff from to

ropetest/refactor/patchedasttest.py

                                          ',', ' ', 'Num', '', ','])
 
     def test_printnl_node(self):
-        source = 'print 1\n'
+        source = 'print(1)\n'
         ast = patchedast.get_patched_ast(source, True)
         checker = _ResultChecker(self, ast)
         checker.check_region('Print', 0, len(source) - 1)
                            '', ':', '\n    ', 'Pass'])
 
     def test_try_except_node(self):
-        source = 'try:\n    pass\nexcept Exception, e:\n    pass\n'
+        source = 'try:\n    pass\nexcept Exception as e:\n    pass\n'
         ast = patchedast.get_patched_ast(source, True)
         checker = _ResultChecker(self, ast)
         checker.check_children(
             if not isinstance(expected, (tuple, list)):
                 goals = [expected]
             for goal in goals:
-                if goal == '' or isinstance(child, basestring):
+                if goal == '' or isinstance(child, str):
                     self.test_case.assertEquals(goal, child)
                     break
             else: