File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
graalpython/com.oracle.graal.python.test/src/tests Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def unlink(file_name):
5454
5555
5656def test_read_write_file ():
57- import _pyio as pyio # Python implementation.
57+ import _pyio as pyio # Python implementation.
5858
5959 file_name = "dump.txt"
6060
@@ -88,7 +88,7 @@ def try_one(s):
8888
8989
9090def test_file ():
91- import _pyio as pyio # Python implementation.
91+ import _pyio as pyio # Python implementation.
9292 file_name = "dump.txt"
9393
9494 unlink (file_name )
@@ -153,3 +153,22 @@ class NonString:
153153 assert f .closed
154154 finally :
155155 unlink (file_name )
156+
157+
158+ def test_builtin_open ():
159+ import _pyio as pyio # Python implementation.
160+ file_name = "mymodule.py"
161+
162+ f = pyio .open (file_name , "w" )
163+ f .write ('print(42)\n ' )
164+ f .close ()
165+
166+ success = True
167+ try :
168+ exec (open (file_name ).read ())
169+ exec (compile (open (file_name , "r" ).read (), file_name , "eval" ))
170+ except Exception as e :
171+ print (e )
172+ success = False
173+
174+ assert success
You can’t perform that action at this time.
0 commit comments