Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_juliainfo_failure():
with pytest.raises(subprocess.CalledProcessError) as excinfo:
JuliaInfo.load(julia="false")
assert excinfo.value.cmd[0] == "false"
assert excinfo.value.returncode == 1
assert isinstance(excinfo.value.output, str)
import sys
import pytest
from .test_compatible_exe import runcode
from julia.core import JuliaInfo
juliainfo = JuliaInfo.load()
@pytest.mark.skipif("juliainfo.version_info < (0, 7)")
@pytest.mark.julia
def test_compiled_modules_no():
runcode(
sys.executable,
"""
from julia.core import Julia
Julia(debug=True, compiled_modules=False)
from julia import Main
use_compiled_modules = Main.eval("Base.JLOptions().use_compiled_modules")
print("use_compiled_modules =", use_compiled_modules)
def test_juliainfo_normal():
jlinfo = JuliaInfo.load(os.getenv("PYJULIA_TEST_RUNTIME", "julia"))
check_core_juliainfo(jlinfo)
assert os.path.exists(jlinfo.python)
# Note: jlinfo.libpython is probably not a full path so we are not