[Python-3000-checkins] r53734 - python/branches/p3yk/Lib/test/test_with.py

guido.van.rossum python-3000-checkins at python.org
Sun Feb 11 08:05:22 CET 2007


Author: guido.van.rossum
Date: Sun Feb 11 08:05:21 2007
New Revision: 53734

Modified:
   python/branches/p3yk/Lib/test/test_with.py
Log:
With the help of the improved fixer, test_with.py is now fixed.


Modified: python/branches/p3yk/Lib/test/test_with.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_with.py	(original)
+++ python/branches/p3yk/Lib/test/test_with.py	Sun Feb 11 08:05:21 2007
@@ -550,13 +550,13 @@
     def testSingleComplexTarget(self):
         targets = {1: [0, 1, 2]}
         with mock_contextmanager_generator() as targets[1][0]:
-            self.assertEqual(targets.keys(), [1])
+            self.assertEqual(list(targets.keys()), [1])
             self.assertEqual(targets[1][0].__class__, MockResource)
-        with mock_contextmanager_generator() as targets.values()[0][1]:
-            self.assertEqual(targets.keys(), [1])
+        with mock_contextmanager_generator() as list(targets.values())[0][1]:
+            self.assertEqual(list(targets.keys()), [1])
             self.assertEqual(targets[1][1].__class__, MockResource)
         with mock_contextmanager_generator() as targets[2]:
-            keys = targets.keys()
+            keys = list(targets.keys())
             keys.sort()
             self.assertEqual(keys, [1, 2])
         class C: pass
@@ -571,7 +571,7 @@
         targets = {1: [0, 1, 2]}
         with C() as (targets[1][0], targets[1][1], targets[1][2]):
             self.assertEqual(targets, {1: [1, 2, 3]})
-        with C() as (targets.values()[0][2], targets.values()[0][1], targets.values()[0][0]):
+        with C() as (list(targets.values())[0][2], list(targets.values())[0][1], list(targets.values())[0][0]):
             self.assertEqual(targets, {1: [3, 2, 1]})
         with C() as (targets[1], targets[2], targets[3]):
             self.assertEqual(targets, {1: 1, 2: 2, 3: 3})


More information about the Python-3000-checkins mailing list