Skip to content

Commit 8c8f10a

Browse files
author
Christopher Doris
committed
update tests for new PyArray parameterisation
1 parent 99140c7 commit 8c8f10a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/Wrap.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@testitem "PyArray" begin
22
x = pyimport("array").array("i", pylist([1, 2, 3]))
33
y = PyArray(x)
4-
z = PyArray{Cint,1,false,false,Cint}(x)
4+
z = PyArray{Cint,1,()}(x)
55
@testset "construct" begin
6-
@test y isa PyArray{Cint,1,true,true,Cint}
7-
@test z isa PyArray{Cint,1,false,false,Cint}
6+
@test y isa PyArray{Cint,1,(:mutable,:linear,:contiguous)}
7+
@test z isa PyArray{Cint,1,()}
88
@test PythonCall.ispy(y)
99
@test PythonCall.ispy(z)
1010
@test Py(y) === x
@@ -29,9 +29,10 @@
2929
@testset "elsize" begin
3030
@test Base.elsize(y) === sizeof(Cint)
3131
@test Base.elsize(z) === sizeof(Cint)
32-
@test Base.elsize(PyArray{Cint,1,true,true,Cint}) === sizeof(Cint)
33-
@test Base.elsize(PyArray{Cint,1,false,false,Cint}) === sizeof(Cint)
34-
@test_throws Exception elsize(PyArray{Cint,1,true,false,Cchar})
32+
@test Base.elsize(PyArray{UInt8}) === sizeof(UInt8)
33+
@test Base.elsize(PyArray{UInt16,2}) === sizeof(UInt16)
34+
@test Base.elsize(PyArray{UInt32,3,(:mutable,)}) === sizeof(UInt32)
35+
@test_throws Exception elsize(PyArray{Py,1,()})
3536
end
3637
@testset "getindex" begin
3738
@test_throws BoundsError y[0]

0 commit comments

Comments
 (0)