File tree 1 file changed +35
-1
lines changed
1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 16
16
17
17
18
18
def _get_paths (path ):
19
- return filter (None , path .split (":" ))
19
+ return list ( filter (None , path .split (":" ) ))
20
20
21
21
22
22
# Environment variable PYJULIA_TEST_INCOMPATIBLE_PYTHONS is the
@@ -134,3 +134,37 @@ def test_incompatible_python(python):
134
134
assert "`libpython` have to match" in proc .stderr
135
135
elif dynamic is False :
136
136
assert "is statically linked to libpython" in proc .stderr
137
+
138
+
139
+ @pytest .mark .parametrize (
140
+ "python" ,
141
+ [
142
+ p
143
+ for p in filter (None , map (which , incompatible_pythons ))
144
+ if is_dynamically_linked (p ) is False
145
+ ],
146
+ )
147
+ def test_statically_linked (python ):
148
+ """
149
+ Simulate the case PyCall is configured with statically linked Python.
150
+
151
+ In this case, `find_libpython()` would return the path identical
152
+ to the one in PyCall's deps.jl. `is_compatible_exe` should reject
153
+ it.
154
+ """
155
+ python = which (python )
156
+ proc = runcode (
157
+ python ,
158
+ """
159
+ from __future__ import print_function
160
+ from julia.find_libpython import find_libpython
161
+ from julia.core import is_compatible_exe
162
+
163
+ class jlinfo:
164
+ libpython = find_libpython()
165
+
166
+ assert not is_compatible_exe(jlinfo, _debug=print)
167
+ """ ,
168
+ )
169
+ print_completed_proc (proc )
170
+ assert proc .returncode == 0
You can’t perform that action at this time.
0 commit comments