|
16 | 16 | ) |
17 | 17 |
|
18 | 18 |
|
19 | | -def do_rename(source, locals, globals): |
| 19 | +def do_rename(source, allow_locals, allow_globals): |
20 | 20 | # This will raise if the source file can't be parsed |
21 | 21 | module = ast.parse(source, 'test_match_rename') |
22 | 22 | add_namespace(module) |
23 | 23 | bind_names(module) |
24 | 24 | resolve_names(module) |
25 | 25 |
|
26 | | - allow_rename_locals(module, locals) |
27 | | - allow_rename_globals(module, globals) |
| 26 | + allow_rename_locals(module, allow_locals) |
| 27 | + allow_rename_globals(module, allow_globals) |
28 | 28 |
|
29 | 29 | rename_literals(module) |
30 | 30 | rename(module) |
@@ -70,7 +70,7 @@ def C(): |
70 | 70 | ''' |
71 | 71 |
|
72 | 72 | expected_ast = ast.parse(expected) |
73 | | - actual_ast = do_rename(source, locals=False, globals=True) |
| 73 | + actual_ast = do_rename(source, allow_locals=False, allow_globals=True) |
74 | 74 | assert_code(expected_ast, actual_ast) |
75 | 75 |
|
76 | 76 |
|
@@ -109,7 +109,7 @@ def func(expensive_rename): |
109 | 109 | ''' |
110 | 110 |
|
111 | 111 | expected_ast = ast.parse(expected) |
112 | | - actual_ast = do_rename(source, locals=True, globals=False) |
| 112 | + actual_ast = do_rename(source, allow_locals=True, allow_globals=False) |
113 | 113 | assert_code(expected_ast, actual_ast) |
114 | 114 |
|
115 | 115 |
|
@@ -142,7 +142,7 @@ def func(expensive_rename): |
142 | 142 | ''' |
143 | 143 |
|
144 | 144 | expected_ast = ast.parse(expected) |
145 | | - actual_ast = do_rename(source, locals=True, globals=False) |
| 145 | + actual_ast = do_rename(source, allow_locals=True, allow_globals=False) |
146 | 146 | assert_code(expected_ast, actual_ast) |
147 | 147 |
|
148 | 148 |
|
@@ -180,7 +180,7 @@ def C(expensive_rename): |
180 | 180 | ''' |
181 | 181 |
|
182 | 182 | expected_ast = ast.parse(expected) |
183 | | - actual_ast = do_rename(source, locals=False, globals=True) |
| 183 | + actual_ast = do_rename(source, allow_locals=False, allow_globals=True) |
184 | 184 | assert_code(expected_ast, actual_ast) |
185 | 185 |
|
186 | 186 |
|
@@ -213,7 +213,7 @@ def func(expensive_rename): |
213 | 213 | ''' |
214 | 214 |
|
215 | 215 | expected_ast = ast.parse(expected) |
216 | | - actual_ast = do_rename(source, locals=True, globals=False) |
| 216 | + actual_ast = do_rename(source, allow_locals=True, allow_globals=False) |
217 | 217 | assert_code(expected_ast, actual_ast) |
218 | 218 |
|
219 | 219 |
|
@@ -246,7 +246,7 @@ def B(expensive_rename): |
246 | 246 | ''' |
247 | 247 |
|
248 | 248 | expected_ast = ast.parse(expected) |
249 | | - actual_ast = do_rename(source, locals=False, globals=True) |
| 249 | + actual_ast = do_rename(source, allow_locals=False, allow_globals=True) |
250 | 250 | assert_code(expected_ast, actual_ast) |
251 | 251 |
|
252 | 252 |
|
@@ -303,7 +303,7 @@ class A: pass |
303 | 303 | ''' |
304 | 304 |
|
305 | 305 | expected_ast = ast.parse(expected) |
306 | | - actual_ast = do_rename(source, locals=True, globals=False) |
| 306 | + actual_ast = do_rename(source, allow_locals=True, allow_globals=False) |
307 | 307 | assert_code(expected_ast, actual_ast) |
308 | 308 |
|
309 | 309 |
|
@@ -358,5 +358,5 @@ class Local: pass |
358 | 358 | ''' |
359 | 359 |
|
360 | 360 | expected_ast = ast.parse(expected) |
361 | | - actual_ast = do_rename(source, locals=False, globals=True) |
| 361 | + actual_ast = do_rename(source, allow_locals=False, allow_globals=True) |
362 | 362 | assert_code(expected_ast, actual_ast) |
0 commit comments