File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change 3939end
4040
4141@testitem " PyCall.jl" begin
42- using PyCall
43- same = Base. get_extension (PythonCall, :PyCallExt ). SAME[]:: Bool
44- @info " testing PyCall" same
45- if get (ENV , " CI" , " " ) != " "
46- # ensure we test both `same` and `!same` in CI
47- @test same == (ENV [" JULIA_PYTHONCALL_EXE" ] == " python" )
48- end
49- if same
42+ if (get (ENV , " CI" , " " ) != " " ) && (ENV [" JULIA_PYTHONCALL_EXE" ] == " python" )
43+ # Only run this test when we can guarantee PyCall and PythonCall are using the
44+ # same Python. Currently this only runs in CI, and if PythonCall is using the
45+ # system Python installation.
46+ using PyCall
47+ # Check they are indeed using the same Python.
48+ @test Base. get_extension (PythonCall, :PyCallExt ). SAME[]
49+ # Check we can round-trip and object PythonCall -> PyCall -> PythonCall and
50+ # have the same identical Python object afterward.
5051 x1 = pylist ():: Py
5152 x2 = PyCall. PyObject (x1):: PyCall.PyObject
5253 x3 = Py (x2):: Py
5354 @test pyis (x3, x1)
5455 else
55- x1 = pylist ():: Py
56- @test_throws " only possible when using the same Python" PyCall. PyObject (x1)
57- x2 = PyCall. pybuiltin (" list" )():: PyCall.PyObject
58- @test_throws " only possible when using the same Python" Py (x2)
56+ @warn " Skipping PyCall.jl tests."
5957 end
6058end
6159
You can’t perform that action at this time.
0 commit comments