mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	gh-116030: test_unparse: Add `ctx argument to ast.Name` calls (#116031)
				
					
				
			This commit is contained in:
		
							parent
							
								
									1752b51012
								
							
						
					
					
						commit
						3b63d0769f
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -370,13 +370,13 @@ def test_slices(self):
 | 
			
		|||
        self.check_ast_roundtrip("a[i:j, k]")
 | 
			
		||||
 | 
			
		||||
    def test_invalid_raise(self):
 | 
			
		||||
        self.check_invalid(ast.Raise(exc=None, cause=ast.Name(id="X")))
 | 
			
		||||
        self.check_invalid(ast.Raise(exc=None, cause=ast.Name(id="X", ctx=ast.Load())))
 | 
			
		||||
 | 
			
		||||
    def test_invalid_fstring_value(self):
 | 
			
		||||
        self.check_invalid(
 | 
			
		||||
            ast.JoinedStr(
 | 
			
		||||
                values=[
 | 
			
		||||
                    ast.Name(id="test"),
 | 
			
		||||
                    ast.Name(id="test", ctx=ast.Load()),
 | 
			
		||||
                    ast.Constant(value="test")
 | 
			
		||||
                ]
 | 
			
		||||
            )
 | 
			
		||||
| 
						 | 
				
			
			@ -718,7 +718,7 @@ def test_function_with_type_params_and_bound(self):
 | 
			
		|||
            body=[ast.Pass()],
 | 
			
		||||
            decorator_list=[],
 | 
			
		||||
            returns=None,
 | 
			
		||||
            type_params=[ast.TypeVar("T", bound=ast.Name("int"))],
 | 
			
		||||
            type_params=[ast.TypeVar("T", bound=ast.Name("int", ctx=ast.Load()))],
 | 
			
		||||
        )
 | 
			
		||||
        ast.fix_missing_locations(node)
 | 
			
		||||
        self.assertEqual(ast.unparse(node), "def f[T: int]():\n    pass")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue