8000 gh-116030: test_unparse: Add ``ctx`` argument to ``ast.Name`` calls (… · python/cpython@3b63d07 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b63d07

Browse files
authored
gh-116030: test_unparse: Add ctx argument to ast.Name calls (#116031)
1 parent 1752b51 commit 3b63d07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_unparse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ def test_slices(self):
370370
self.check_ast_roundtrip("a[i:j, k]")
371371

372372
def test_invalid_raise(self):
373-
self.check_invalid(ast.Raise(exc=None, cause=ast.Name(id="X")))
373+
self.check_invalid(ast.Raise(exc=None, cause=ast.Name(id="X", ctx=ast.Load())))
374374

375375
def test_invalid_fstring_value(self):
376376
self.check_invalid(
377377
ast.JoinedStr(
378378
values=[
379-
ast.Name(id="test"),
379+
ast.Name(id="test", ctx=ast.Load()),
380380
ast.Constant(value="test")
381381
]
382382
)
@@ -718,7 +718,7 @@ def test_function_with_type_params_and_bound(self):
718718
body=[ast.Pass()],
719719
decorator_list=[],
720720
returns=None,
721-
type_params=[ast.TypeVar("T", bound=ast.Name("int"))],
721+
type_params=[ast.TypeVar("T", bound=ast.Name("int", ctx=ast.Load()))],
722722
)
723723
ast.fix_missing_locations(node)
724724
self.assertEqual(ast.unparse(node), "def f[T: int]():\n pass")

0 commit comments

Comments
 (0)
0