diff options
author | Aviral Srivastava <avi.srivastava254084@gmail.com> | 2021-02-01 17:38:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 17:38:44 (GMT) |
commit | 000cde59847beaf5fa7b73633e1f3c898fe5bf90 (patch) | |
tree | 9b6036270daecbf44973288fed04215eeb8d24a5 /Lib/idlelib/idle_test | |
parent | b5931f1d9f1f9f907e5cb6e193154672f78c1225 (diff) | |
download | cpython-000cde59847beaf5fa7b73633e1f3c898fe5bf90.zip cpython-000cde59847beaf5fa7b73633e1f3c898fe5bf90.tar.gz cpython-000cde59847beaf5fa7b73633e1f3c898fe5bf90.tar.bz2 |
bpo-38307: Add end_lineno attribute to pyclbr Objects (GH-24348)
For back-compatibility, make the new constructor parameter for public classes Function and Class
keyword-only with a default of None.
Co-authored-by: Aviral Srivastava <aviralsrivastava@Avirals-MacBook-Air.local
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_browser.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/idlelib/idle_test/test_browser.py b/Lib/idlelib/idle_test/test_browser.py index 25d6dc6..03a50f2 100644 --- a/Lib/idlelib/idle_test/test_browser.py +++ b/Lib/idlelib/idle_test/test_browser.py @@ -61,15 +61,15 @@ class ModuleBrowserTest(unittest.TestCase): # Nested tree same as in test_pyclbr.py except for supers on C0. C1. mb = pyclbr module, fname = 'test', 'test.py' -C0 = mb.Class(module, 'C0', ['base'], fname, 1) -F1 = mb._nest_function(C0, 'F1', 3) -C1 = mb._nest_class(C0, 'C1', 6, ['']) -C2 = mb._nest_class(C1, 'C2', 7) -F3 = mb._nest_function(C2, 'F3', 9) -f0 = mb.Function(module, 'f0', fname, 11) -f1 = mb._nest_function(f0, 'f1', 12) -f2 = mb._nest_function(f1, 'f2', 13) -c1 = mb._nest_class(f0, 'c1', 15) +C0 = mb.Class(module, 'C0', ['base'], fname, 1, end_lineno=9) +F1 = mb._nest_function(C0, 'F1', 3, 5) +C1 = mb._nest_class(C0, 'C1', 6, 9, ['']) +C2 = mb._nest_class(C1, 'C2', 7, 9) +F3 = mb._nest_function(C2, 'F3', 9, 9) +f0 = mb.Function(module, 'f0', fname, 11, end_lineno=15) +f1 = mb._nest_function(f0, 'f1', 12, 14) +f2 = mb._nest_function(f1, 'f2', 13, 13) +c1 = mb._nest_class(f0, 'c1', 15, 15) mock_pyclbr_tree = {'C0': C0, 'f0': f0} # Adjust C0.name, C1.name so tests do not depend on order. |