Skip to content

Commit c741105

Browse files
committed
Add test for locals sync
1 parent ae06baa commit c741105

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_frame_tests.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ def test_builtins():
126126
assert print == sys._getframe().f_builtins["print"]
127127

128128

129+
def test_locals_sync():
130+
a = 1
131+
l = locals()
132+
assert l == {'a': 1}
133+
b = 2
134+
# Forces caller frame materialization, this used to erroneously cause the locals dict to update
135+
globals()
136+
assert l == {'a': 1}
137+
# Now this should really cause the locals dict to update
138+
locals()
139+
assert l == {'a': 1, 'b': 2, 'l': l}
140+
141+
129142
# GR-22089
130143
# def test_backref_from_traceback():
131144
# def bar():

0 commit comments

Comments
 (0)