Skip to content

Commit

Permalink
pythongh-104635: Add a test case for variables that have a dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Jul 10, 2023
1 parent 93d292c commit e92bc67
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lib/test/test_compile.py
Expand Up @@ -1186,6 +1186,12 @@ def f(x, y, z):
return a
self.assertEqual(f("x", "y", "z"), "y")

def test_variable_dependent(self):
def f():
a = 42; b = a + 54; a = 54
return a, b
self.assertEqual(f(), (54, 96))


@requires_debug_ranges()
class TestSourcePositions(unittest.TestCase):
Expand Down

0 comments on commit e92bc67

Please sign in to comment.