summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2018-06-20 03:00:35 (GMT)
committerGitHub <noreply@github.com>2018-06-20 03:00:35 (GMT)
commit06e2029dfa500a42e3565ed7ba8573412f153d1c (patch)
treef9fe4e4683e94c09ef7d807295c3f8c26b00b437 /Lib/idlelib/idle_test
parent4d92158f4c3917fc4fbfebff15224e74782abf79 (diff)
downloadcpython-06e2029dfa500a42e3565ed7ba8573412f153d1c.zip
cpython-06e2029dfa500a42e3565ed7ba8573412f153d1c.tar.gz
cpython-06e2029dfa500a42e3565ed7ba8573412f153d1c.tar.bz2
bpo-33907: Rename an IDLE module and class. (GH-7807)
Improve consistency and appearance. Module idlelib.calltips is now calltip. Class idlelib.calltip_w.CallTip is now Calltip.
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r--Lib/idlelib/idle_test/test_calltip.py (renamed from Lib/idlelib/idle_test/test_calltips.py)26
-rw-r--r--Lib/idlelib/idle_test/test_calltip_w.py2
2 files changed, 14 insertions, 14 deletions
diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltip.py
index 2cf0e18..0698d4f 100644
--- a/Lib/idlelib/idle_test/test_calltips.py
+++ b/Lib/idlelib/idle_test/test_calltip.py
@@ -1,11 +1,11 @@
-"Test calltips, coverage 60%"
+"Test calltip, coverage 60%"
-from idlelib import calltips
+from idlelib import calltip
import unittest
import textwrap
import types
-default_tip = calltips._default_callable_argspec
+default_tip = calltip._default_callable_argspec
# Test Class TC is used in multiple get_argspec test methods
@@ -36,7 +36,7 @@ class TC():
tc = TC()
-signature = calltips.get_argspec # 2.7 and 3.x use different functions
+signature = calltip.get_argspec # 2.7 and 3.x use different functions
class Get_signatureTest(unittest.TestCase):
@@ -59,7 +59,7 @@ class Get_signatureTest(unittest.TestCase):
self.assertEqual(signature(obj), out)
if List.__doc__ is not None:
- gtest(List, '(iterable=(), /)' + calltips._argument_positional
+ gtest(List, '(iterable=(), /)' + calltip._argument_positional
+ '\n' + List.__doc__)
gtest(list.__new__,
'(*args, **kwargs)\n'
@@ -67,9 +67,9 @@ class Get_signatureTest(unittest.TestCase):
'See help(type) for accurate signature.')
gtest(list.__init__,
'(self, /, *args, **kwargs)'
- + calltips._argument_positional + '\n' +
+ + calltip._argument_positional + '\n' +
'Initialize self. See help(type(self)) for accurate signature.')
- append_doc = (calltips._argument_positional
+ append_doc = (calltip._argument_positional
+ "\nAppend object to the end of the list.")
gtest(list.append, '(self, object, /)' + append_doc)
gtest(List.append, '(self, object, /)' + append_doc)
@@ -102,7 +102,7 @@ non-overlapping occurrences o...''')
def test_docline_truncation(self):
def f(): pass
f.__doc__ = 'a'*300
- self.assertEqual(signature(f), '()\n' + 'a' * (calltips._MAX_COLS-3) + '...')
+ self.assertEqual(signature(f), '()\n' + 'a' * (calltip._MAX_COLS-3) + '...')
def test_multiline_docstring(self):
# Test fewer lines than max.
@@ -121,7 +121,7 @@ bytes() -> empty bytes object''')
# Test more than max lines
def f(): pass
f.__doc__ = 'a\n' * 15
- self.assertEqual(signature(f), '()' + '\na' * calltips._MAX_LINES)
+ self.assertEqual(signature(f), '()' + '\na' * calltip._MAX_LINES)
def test_functions(self):
def t1(): 'doc'
@@ -168,7 +168,7 @@ bytes() -> empty bytes object''')
class Test:
def __call__(*, a): pass
- mtip = calltips._invalid_method
+ mtip = calltip._invalid_method
self.assertEqual(signature(C().m2), mtip)
self.assertEqual(signature(Test()), mtip)
@@ -176,7 +176,7 @@ bytes() -> empty bytes object''')
# test that re works to delete a first parameter name that
# includes non-ascii chars, such as various forms of A.
uni = "(A\u0391\u0410\u05d0\u0627\u0905\u1e00\u3042, a)"
- assert calltips._first_param.sub('', uni) == '(a)'
+ assert calltip._first_param.sub('', uni) == '(a)'
def test_no_docstring(self):
def nd(s):
@@ -209,9 +209,9 @@ bytes() -> empty bytes object''')
class Get_entityTest(unittest.TestCase):
def test_bad_entity(self):
- self.assertIsNone(calltips.get_entity('1/0'))
+ self.assertIsNone(calltip.get_entity('1/0'))
def test_good_entity(self):
- self.assertIs(calltips.get_entity('int'), int)
+ self.assertIs(calltip.get_entity('int'), int)
if __name__ == '__main__':
diff --git a/Lib/idlelib/idle_test/test_calltip_w.py b/Lib/idlelib/idle_test/test_calltip_w.py
index 03f1e9a..fc1f111 100644
--- a/Lib/idlelib/idle_test/test_calltip_w.py
+++ b/Lib/idlelib/idle_test/test_calltip_w.py
@@ -14,7 +14,7 @@ class CallTipTest(unittest.TestCase):
cls.root = Tk()
cls.root.withdraw()
cls.text = Text(cls.root)
- cls.calltip = calltip_w.CallTip(cls.text)
+ cls.calltip = calltip_w.Calltip(cls.text)
@classmethod
def tearDownClass(cls):