summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test
diff options
context:
space:
mode:
authorEmmanuel Arias <emmanuelarias30@gmail.com>2019-01-03 07:47:58 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2019-01-03 07:47:58 (GMT)
commitab54b9a130c88f708077c2ef6c4963b632c132b3 (patch)
tree7f57fa7d5bdd93e0774089123792cd92bc7ff083 /Lib/idlelib/idle_test
parentaff0adabf3ace62073076f4ce875ff568f2d3180 (diff)
downloadcpython-ab54b9a130c88f708077c2ef6c4963b632c132b3.zip
cpython-ab54b9a130c88f708077c2ef6c4963b632c132b3.tar.gz
cpython-ab54b9a130c88f708077c2ef6c4963b632c132b3.tar.bz2
bpo-35641: IDLE - format calltip properly when no docstring (GH-11415)
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r--Lib/idlelib/idle_test/test_calltip.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py
index 0698d4f..833351b 100644
--- a/Lib/idlelib/idle_test/test_calltip.py
+++ b/Lib/idlelib/idle_test/test_calltip.py
@@ -99,6 +99,35 @@ non-overlapping occurrences o...''')
drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None,
placeholder=' [...]')''')
+ def test_properly_formated(self):
+ def foo(s='a'*100):
+ pass
+
+ def bar(s='a'*100):
+ """Hello Guido"""
+ pass
+
+ def baz(s='a'*100, z='b'*100):
+ pass
+
+ indent = calltip._INDENT
+
+ str_foo = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
+ "aaaaaaaaaa')"
+ str_bar = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
+ "aaaaaaaaaa')\nHello Guido"
+ str_baz = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
+ "aaaaaaaaaa', z='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"\
+ "bbbbbbbbbbbbbbbbb\n" + indent + "bbbbbbbbbbbbbbbbbbbbbb"\
+ "bbbbbbbbbbbbbbbbbbbbbb')"
+
+ self.assertEqual(calltip.get_argspec(foo), str_foo)
+ self.assertEqual(calltip.get_argspec(bar), str_bar)
+ self.assertEqual(calltip.get_argspec(baz), str_baz)
+
def test_docline_truncation(self):
def f(): pass
f.__doc__ = 'a'*300