Skip to content

Commit ab0291d

Browse files
fangerertimfel
authored andcommitted
Test C ext extraction in standalone
(cherry picked from commit 05a43a5)
1 parent db5ebef commit ab0291d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,16 @@ def test_native_executable_venv_and_one_file():
180180
f.write("from termcolor import colored, cprint\n")
181181
f.write("colored_text = colored('hello standalone world', 'red', attrs=['reverse', 'blink'])\n")
182182
f.write("print(colored_text)\n")
183+
f.write("import ujson\n")
184+
f.write('d = ujson.loads("""{"key": "value"}""")\n')
185+
f.write("print('key=' + d['key'])\n")
183186

184187
venv_dir = os.path.join(target_dir, "venv")
185188
cmd = [graalpy, "-m", "venv", venv_dir]
186189
out = run_cmd(cmd, env)
187190

188191
venv_python = os.path.join(venv_dir, "Scripts", "python.cmd") if os.name == "nt" else os.path.join(venv_dir, "bin", "python")
189-
cmd = [venv_python, "-m", "pip", "--no-cache-dir", "install", "termcolor"]
192+
cmd = [venv_python, "-m", "pip", "--no-cache-dir", "install", "termcolor", "ujson"]
190193
out = run_cmd(cmd, env)
191194

192195
target_file = os.path.join(target_dir, "hello")
@@ -198,6 +201,7 @@ def test_native_executable_venv_and_one_file():
198201
out = run_cmd(cmd, env)
199202

200203
assert "hello standalone world" in out
204+
assert "key=value" in out
201205

202206
@unittest.skipUnless(is_enabled, "ENABLE_STANDALONE_UNITTESTS is not true")
203207
def test_native_executable_module():

0 commit comments

Comments
 (0)