summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-02-24 02:24:35 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-02-24 02:24:35 (GMT)
commit300c5cc87463aac8330cf458aaaefdb43943af09 (patch)
treee4742c84442dfd3fcaa8cff884db7994af2dc1cb /Lib/lib2to3
parenteffb24b31bbce50582014455c98a83522fd5ba67 (diff)
downloadcpython-300c5cc87463aac8330cf458aaaefdb43943af09.zip
cpython-300c5cc87463aac8330cf458aaaefdb43943af09.tar.gz
cpython-300c5cc87463aac8330cf458aaaefdb43943af09.tar.bz2
Merged revisions 78407 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r78407 | benjamin.peterson | 2010-02-23 20:21:34 -0600 (Tue, 23 Feb 2010) | 1 line rewrite test to not rely on __doc__ being present ........
Diffstat (limited to 'Lib/lib2to3')
-rw-r--r--Lib/lib2to3/tests/test_refactor.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/lib2to3/tests/test_refactor.py
index 1729027..2023093 100644
--- a/Lib/lib2to3/tests/test_refactor.py
+++ b/Lib/lib2to3/tests/test_refactor.py
@@ -242,21 +242,19 @@ from __future__ import print_function"""
def test_refactor_docstring(self):
rt = self.rt()
- def example():
- """
- >>> example()
- 42
- """
- out = rt.refactor_docstring(example.__doc__, "<test>")
- self.assertEqual(out, example.__doc__)
-
- def parrot():
- """
- >>> def parrot():
- ... return 43
- """
- out = rt.refactor_docstring(parrot.__doc__, "<test>")
- self.assertNotEqual(out, parrot.__doc__)
+ doc = """
+>>> example()
+42
+"""
+ out = rt.refactor_docstring(doc, "<test>")
+ self.assertEqual(out, doc)
+
+ doc = """
+>>> def parrot():
+... return 43
+"""
+ out = rt.refactor_docstring(doc, "<test>")
+ self.assertNotEqual(out, doc)
def test_explicit(self):
from myfixes.fix_explicit import FixExplicit