Skip to content

Commit 8f1f9f4

Browse files
author
Christopher Doris
committed
more juliacall tests + bugfix
1 parent 6975f7c commit 8f1f9f4

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

docs/src/releasenotes.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release Notes
22

3+
## Unreleased
4+
* Bug fixes.
5+
36
## 0.9.16 (2024-03-14)
47
* Big internal refactor.
58
* New unexported functions: `python_executable_path`, `python_library_path`, `python_library_handle` and `python_version`.

pysrc/juliacall/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def convert(T, x):
1818
"Convert x to a Julia T."
1919
global _convert
2020
if _convert is None:
21-
_convert = PythonCall.seval("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))")
21+
_convert = PythonCall.JlWrap.seval("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))")
2222
return _convert(T, x)
2323

2424
def interactive(enable=True):

pytest/test_all.py

+21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
def test_import():
22
import juliacall
33

4+
def test_newmodule():
5+
import juliacall
6+
jl = juliacall.Main
7+
m = juliacall.newmodule("TestModule")
8+
assert isinstance(m, juliacall.ModuleValue)
9+
assert jl.isa(m, jl.Module)
10+
assert str(jl.nameof(m)) == "TestModule"
11+
12+
def test_convert():
13+
import juliacall
14+
jl = juliacall.Main
15+
for (x, t) in [(None, jl.Nothing), (True, jl.Bool), ([1,2,3], jl.Vector)]:
16+
y = juliacall.convert(t, x)
17+
assert isinstance(y, juliacall.AnyValue)
18+
assert jl.isa(y, t)
19+
20+
def test_interactive():
21+
import juliacall
22+
juliacall.interactive(True)
23+
juliacall.interactive(False)
24+
425
def test_issue_394():
526
"https://github.com/JuliaPy/PythonCall.jl/issues/394"
627
from juliacall import Main as jl

0 commit comments

Comments
 (0)