]> granicus.if.org Git - python/commitdiff
Issue #23182: PEP8-ify the annotation grammar tests. Patch by Ian Lee.
authorZachary Ware <zachary.ware@gmail.com>
Sun, 2 Aug 2015 02:55:36 +0000 (21:55 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Sun, 2 Aug 2015 02:55:36 +0000 (21:55 -0500)
Lib/test/test_grammar.py

index 70d85b1c330a7d3743a4087bcd51467049fa8a20..fb5ffc06b18b5766398f1577d5cdf6a5d2efe606 100644 (file)
@@ -302,27 +302,27 @@ class GrammarTests(unittest.TestCase):
         # argument annotation tests
         def f(x) -> list: pass
         self.assertEqual(f.__annotations__, {'return': list})
-        def f(x:int): pass
+        def f(x: int): pass
         self.assertEqual(f.__annotations__, {'x': int})
-        def f(*x:str): pass
+        def f(*x: str): pass
         self.assertEqual(f.__annotations__, {'x': str})
-        def f(**x:float): pass
+        def f(**x: float): pass
         self.assertEqual(f.__annotations__, {'x': float})
-        def f(x, y:1+2): pass
+        def f(x, y: 1+2): pass
         self.assertEqual(f.__annotations__, {'y': 3})
-        def f(a, b:1, c:2, d): pass
+        def f(a, b: 1, c: 2, d): pass
         self.assertEqual(f.__annotations__, {'b': 1, 'c': 2})
-        def f(a, b:1, c:2, d, e:3=4, f=5, *g:6): pass
+        def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6): pass
         self.assertEqual(f.__annotations__,
-                          {'b': 1, 'c': 2, 'e': 3, 'g': 6})
-        def f(a, b:1, c:2, d, e:3=4, f=5, *g:6, h:7, i=8, j:9=10,
-              **k:11) -> 12: pass
+                         {'b': 1, 'c': 2, 'e': 3, 'g': 6})
+        def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6, h: 7, i=8, j: 9 = 10,
+              **k: 11) -> 12: pass
         self.assertEqual(f.__annotations__,
-                          {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
-                           'k': 11, 'return': 12})
+                         {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
+                          'k': 11, 'return': 12})
         # Check for issue #20625 -- annotations mangling
         class Spam:
-            def f(self, *, __kw:1):
+            def f(self, *, __kw: 1):
                 pass
         class Ham(Spam): pass
         self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': 1})