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):
54
54
55
55
56
56
def test_read_write_file ():
57
- import _pyio as pyio # Python implementation.
57
+ import _pyio as pyio # Python implementation.
58
58
59
59
file_name = "dump.txt"
60
60
@@ -88,7 +88,7 @@ def try_one(s):
88
88
89
89
90
90
def test_file ():
91
- import _pyio as pyio # Python implementation.
91
+ import _pyio as pyio # Python implementation.
92
92
file_name = "dump.txt"
93
93
94
94
unlink (file_name )
@@ -153,3 +153,22 @@ class NonString:
153
153
assert f .closed
154
154
finally :
155
155
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