@@ -21,22 +21,33 @@ def test_issue_394():
21
21
22
22
def test_integration_pysr ():
23
23
"Integration tests for PySR"
24
+ import os
25
+ import platform
24
26
import subprocess
25
27
import sys
26
28
import tempfile
27
29
28
30
with tempfile .TemporaryDirectory () as tempdir :
29
31
subprocess .run ([sys .executable , "-m" , "virtualenv" , tempdir ], check = True )
32
+
33
+ virtualenv_path = os .path .join (
34
+ tempdir , "Scripts" if platform .system () == "Windows" else "bin"
35
+ )
36
+ virtualenv_executable = os .path .join (virtualenv_path , "python" )
37
+
38
+ assert os .path .exists (virtualenv_executable )
39
+
30
40
# Install this package
31
- subprocess .run ([sys . executable , "-m" , "pip" , "install" , "." ], check = True )
41
+ subprocess .run ([virtualenv_executable , "-m" , "pip" , "install" , "." ], check = True )
32
42
# Install PySR with no requirement on JuliaCall
33
43
subprocess .run (
34
- [sys .executable , "-m" , "pip" , "install" , "--no-deps" , "pysr" ], check = True
44
+ [virtualenv_executable , "-m" , "pip" , "install" , "--no-deps" , "pysr" ],
45
+ check = True ,
35
46
)
36
47
# Install PySR test requirements
37
48
subprocess .run (
38
49
[
39
- sys . executable ,
50
+ virtualenv_executable ,
40
51
"-m" ,
41
52
"pip" ,
42
53
"install" ,
@@ -52,4 +63,6 @@ def test_integration_pysr():
52
63
check = True ,
53
64
)
54
65
# Run PySR main test suite
55
- subprocess .run ([sys .executable , "-m" , "pysr" , "test" , "main" ], check = True )
66
+ subprocess .run (
67
+ [virtualenv_executable , "-m" , "pysr" , "test" , "main" ], check = True
68
+ )
0 commit comments