No space after type hint Closes #351
diff --git a/yapftests/reformatter_python3_test.py b/yapftests/reformatter_python3_test.py index dcc2d64..f9690ee 100644 --- a/yapftests/reformatter_python3_test.py +++ b/yapftests/reformatter_python3_test.py
@@ -151,6 +151,26 @@ finally: style.SetGlobalStyle(style.CreatePEP8Style()) + def testTypeHint(self): + unformatted_code = textwrap.dedent("""\ + def foo(x: int=42): + pass + + + def foo2(x: 'int' =42): + pass + """) + expected_formatted_code = textwrap.dedent("""\ + def foo(x: int=42): + pass + + + def foo2(x: 'int'=42): + pass + """) + uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) + self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) + def testAsyncWithPrecedingComment(self): if sys.version_info[1] < 5: return