diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2018-02-22 06:19:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 06:19:02 (GMT) |
commit | 451d1edaf4d27c4e632d81246d308e8dd6ea945f (patch) | |
tree | d45a69250207e55f723331d205f8310c01267a0f /Lib/idlelib/idle_test | |
parent | 745dc65b17b3936e3f9f4099f735f174d30c4e0c (diff) | |
download | cpython-451d1edaf4d27c4e632d81246d308e8dd6ea945f.zip cpython-451d1edaf4d27c4e632d81246d308e8dd6ea945f.tar.gz cpython-451d1edaf4d27c4e632d81246d308e8dd6ea945f.tar.bz2 |
bpo-32905: IDLE - remove unused code in pyparse module (GH-5807)
dump is similar to print but less flexible. lastopenbracketpos is now always initialized in _study2, as was stmt_bracketing, so the class settings are not needed. get_last_open_bracket_pos is never called.
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_pyparse.py | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/Lib/idlelib/idle_test/test_pyparse.py b/Lib/idlelib/idle_test/test_pyparse.py index b84e9f8..c45815b 100644 --- a/Lib/idlelib/idle_test/test_pyparse.py +++ b/Lib/idlelib/idle_test/test_pyparse.py @@ -1,4 +1,7 @@ -"""Unittest for idlelib.pyparse.py.""" +"""Unittest for idlelib.pyparse.py. + +Coverage: 97% +""" from collections import namedtuple import unittest @@ -272,8 +275,6 @@ class PyParseTest(unittest.TestCase): ) for test in tests: - # There is a bug where this is carried forward from last item. - p.lastopenbracketpos = None with self.subTest(string=test.string): setstr(test.string) study() @@ -464,33 +465,6 @@ class PyParseTest(unittest.TestCase): setstr(test.string) test.assert_(closer()) - def test_get_last_open_bracket_pos(self): - eq = self.assertEqual - p = self.parser - setstr = p.set_str - openbracket = p.get_last_open_bracket_pos - - TestInfo = namedtuple('TestInfo', ['string', 'position']) - tests = ( - TestInfo('', None), - TestInfo('a\n', None), - TestInfo('# (\n', None), - TestInfo('""" (\n', None), - TestInfo('a = (1 + 2) - 5 *\\\n', None), - TestInfo('\n def function1(self, a,\n', 17), - TestInfo('\n def function1(self, a, # End of line comment.\n', 17), - TestInfo('{)(]\n', None), - TestInfo('(((((((((()))))))\n', 2), - TestInfo('(((((((((())\n)))\n))\n', 2), - ) - - for test in tests: - # There is a bug where the value is carried forward from last item. - p.lastopenbracketpos = None - with self.subTest(string=test.string): - setstr(test.string) - eq(openbracket(), test.position) - def test_get_last_stmt_bracketing(self): eq = self.assertEqual p = self.parser |