File tree Expand file tree Collapse file tree 1 file changed +8
-26
lines changed Expand file tree Collapse file tree 1 file changed +8
-26
lines changed Original file line number Diff line number Diff line change @@ -171,35 +171,17 @@ def test_call_nogil(yld, raw):
171171
172172
173173def test_repl ():
174- import sys
174+ import sys , subprocess
175175 import juliapkg
176176 import juliacall as _
177- import subprocess
178- import time
179177
180- jl_version = juliapkg .state .STATE ["version" ]
181-
182- cmd = [sys .executable , '-m' , 'juliacall' ]
183- process = subprocess .Popen (
184- cmd ,
178+ output , _ = subprocess .Popen (
179+ [sys .executable , "-m" , "juliacall" ],
185180 stdin = subprocess .PIPE ,
186181 stdout = subprocess .PIPE ,
187- stderr = subprocess .PIPE ,
188- text = True ,
189- bufsize = 1
190- )
191- output = ""
192- timestart = time .time ()
193- while time .time () - timestart < 100 :
194- char = process .stdout .read (1 )
195- if not char :
196- break
197- output += char
198- if output .endswith ("julia>" ):
199- break
200- assert f"Julia: { jl_version } " in output
182+ stderr = subprocess .STDOUT ,
183+ text = True
184+ ).communicate (input = "" , timeout = 10 )
185+
186+ assert f"Julia: { juliapkg .state .STATE ["version" ]} " in output
201187 assert "julia>" in output
202- process .stdin .write ('\x04 ' ) # Ctrl+D
203- process .stdin .flush ()
204- process .wait ()
205- assert process .returncode == 0
You can’t perform that action at this time.
0 commit comments