[Python-checkins] r57916 - sandbox/trunk/2to3/tests/test_fixers.py

collin.winter python-checkins at python.org
Mon Sep 3 07:49:33 CEST 2007


Author: collin.winter
Date: Mon Sep  3 07:49:33 2007
New Revision: 57916

Modified:
   sandbox/trunk/2to3/tests/test_fixers.py
Log:
Simply a test for the print fixer in the wake of print statement/function autodetection.

Modified: sandbox/trunk/2to3/tests/test_fixers.py
==============================================================================
--- sandbox/trunk/2to3/tests/test_fixers.py	(original)
+++ sandbox/trunk/2to3/tests/test_fixers.py	Mon Sep  3 07:49:33 2007
@@ -358,18 +358,14 @@
         self.unchanged(s)
 
     def test_idempotency_print_as_function(self):
-        print_stmt = pygram.python_grammar.keywords.pop("print")
-        try:
-            s = """print(1, 1+1, 1+1+1)"""
-            self.unchanged(s)
+        s = """print(1, 1+1, 1+1+1)"""
+        self.unchanged(s)
 
-            s = """print()"""
-            self.unchanged(s)
+        s = """print()"""
+        self.unchanged(s)
 
-            s = """print('')"""
-            self.unchanged(s)
-        finally:
-            pygram.python_grammar.keywords["print"] = print_stmt
+        s = """print('')"""
+        self.unchanged(s)
 
     def test_1(self):
         b = """print 1, 1+1, 1+1+1"""


More information about the Python-checkins mailing list