bpo-32411: IDLE: Remove line number sort in browser.py (GH-5011) · python/cpython@ac60d1a (original) (raw)
`@@ -61,16 +61,16 @@ def test_close(self):
`
61
61
`# Nested tree same as in test_pyclbr.py except for supers on C0. C1.
`
62
62
`mb = pyclbr
`
63
63
`module, fname = 'test', 'test.py'
`
64
``
`-
f0 = mb.Function(module, 'f0', fname, 1)
`
65
``
`-
f1 = mb._nest_function(f0, 'f1', 2)
`
66
``
`-
f2 = mb._nest_function(f1, 'f2', 3)
`
67
``
`-
c1 = mb._nest_class(f0, 'c1', 5)
`
68
``
`-
C0 = mb.Class(module, 'C0', ['base'], fname, 6)
`
69
``
`-
F1 = mb._nest_function(C0, 'F1', 8)
`
70
``
`-
C1 = mb._nest_class(C0, 'C1', 11, [''])
`
71
``
`-
C2 = mb._nest_class(C1, 'C2', 12)
`
72
``
`-
F3 = mb._nest_function(C2, 'F3', 14)
`
73
``
`-
mock_pyclbr_tree = {'f0': f0, 'C0': C0}
`
``
64
`+
C0 = mb.Class(module, 'C0', ['base'], fname, 1)
`
``
65
`+
F1 = mb._nest_function(C0, 'F1', 3)
`
``
66
`+
C1 = mb._nest_class(C0, 'C1', 6, [''])
`
``
67
`+
C2 = mb._nest_class(C1, 'C2', 7)
`
``
68
`+
F3 = mb._nest_function(C2, 'F3', 9)
`
``
69
`+
f0 = mb.Function(module, 'f0', fname, 11)
`
``
70
`+
f1 = mb._nest_function(f0, 'f1', 12)
`
``
71
`+
f2 = mb._nest_function(f1, 'f2', 13)
`
``
72
`+
c1 = mb._nest_class(f0, 'c1', 15)
`
``
73
`+
mock_pyclbr_tree = {'C0': C0, 'f0': f0}
`
74
74
``
75
75
`# Adjust C0.name, C1.name so tests do not depend on order.
`
76
76
`browser.transform_children(mock_pyclbr_tree, 'test') # C0(base)
`
`@@ -87,12 +87,12 @@ def test_transform_module_children(self):
`
87
87
`transform = browser.transform_children
`
88
88
`# Parameter matches tree module.
`
89
89
`tcl = list(transform(mock_pyclbr_tree, 'test'))
`
90
``
`-
eq(tcl, [f0, C0])
`
91
``
`-
eq(tcl[0].name, 'f0')
`
92
``
`-
eq(tcl[1].name, 'C0(base)')
`
``
90
`+
eq(tcl, [C0, f0])
`
``
91
`+
eq(tcl[0].name, 'C0(base)')
`
``
92
`+
eq(tcl[1].name, 'f0')
`
93
93
`# Check that second call does not change suffix.
`
94
94
`tcl = list(transform(mock_pyclbr_tree, 'test'))
`
95
``
`-
eq(tcl[1].name, 'C0(base)')
`
``
95
`+
eq(tcl[0].name, 'C0(base)')
`
96
96
`# Nothing to traverse if parameter name isn't same as tree module.
`
97
97
`tcl = list(transform(mock_pyclbr_tree, 'different name'))
`
98
98
`eq(tcl, [])
`