Skip to content

Commit 19defce

Browse files
committed
GR-20806: add unittest for creating code object from codestring
1 parent 88a3dff commit 19defce

File tree

1 file changed

+8
-0
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,11 @@ def test_get_globals():
175175
if sys.implementation.name == 'graalpython':
176176
from __graalpython__ import current_global_code_variables
177177
assert set(current_global_code_variables(code)) == {'a_global'}
178+
179+
180+
def test_codestring():
181+
def foo():
182+
pass
183+
184+
ct = type(foo.__code__)
185+
ct(2, 0, 0, 128, 0, b"lambda a,b: a+b", tuple(), ("a", "b"), tuple(), "hello.py", "<lambda>", 0, b"", tuple(), tuple())

0 commit comments

Comments
 (0)