diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/lib2to3/tests/test_refactor.py index 2263f50eeb7..49fb0c044d4 100644 --- a/Lib/lib2to3/tests/test_refactor.py +++ b/Lib/lib2to3/tests/test_refactor.py @@ -242,21 +242,19 @@ def test_crlf_newlines(self): def test_refactor_docstring(self): rt = self.rt() - def example(): - """ - >>> example() - 42 - """ - out = rt.refactor_docstring(example.__doc__, "") - self.assertEqual(out, example.__doc__) + doc = """ +>>> example() +42 +""" + out = rt.refactor_docstring(doc, "") + self.assertEqual(out, doc) - def parrot(): - """ - >>> def parrot(): - ... return 43 - """ - out = rt.refactor_docstring(parrot.__doc__, "") - self.assertNotEqual(out, parrot.__doc__) + doc = """ +>>> def parrot(): +... return 43 +""" + out = rt.refactor_docstring(doc, "") + self.assertNotEqual(out, doc) def test_explicit(self): from myfixes.fix_explicit import FixExplicit