Skip to content

Commit

Permalink
more juliacall tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Doris committed Mar 16, 2024
1 parent 8f1f9f4 commit 8021e5a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pytest/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ def test_interactive():
juliacall.interactive(True)
juliacall.interactive(False)

def test_JuliaError():
import juliacall
jl = juliacall.Main
assert isinstance(juliacall.JuliaError, type)
assert issubclass(juliacall.JuliaError, Exception)
try:
juliacall.Base.error("test error")
err = None
except juliacall.JuliaError as e:
err = e
assert err is not None
assert isinstance(err, juliacall.JuliaError)
exc = err.exception
assert jl.isa(exc, jl.ErrorException)
assert str(exc.msg) == "test error"
bt = err.backtrace
assert bt is not None

def test_issue_394():
"https://github.com/JuliaPy/PythonCall.jl/issues/394"
from juliacall import Main as jl
Expand Down

0 comments on commit 8021e5a

Please sign in to comment.