Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
cccfa3de
Commit
cccfa3de
authored
Apr 11, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip numpy inline test rather than discarding it if numpy is not installed.
parent
10c2fa4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
Cython/Build/Tests/TestInline.py
Cython/Build/Tests/TestInline.py
+10
-9
No files found.
Cython/Build/Tests/TestInline.py
View file @
cccfa3de
import
os
,
tempfile
import
os
import
tempfile
import
unittest
from
Cython.Shadow
import
inline
from
Cython.Build.Inline
import
safe_type
from
Cython.TestUtils
import
CythonTest
...
...
@@ -86,11 +88,10 @@ class TestInline(CythonTest):
2.5
)
if
has_numpy
:
def
test_numpy
(
self
):
import
numpy
a
=
numpy
.
ndarray
((
10
,
20
))
a
[
0
,
0
]
=
10
self
.
assertEqual
(
safe_type
(
a
),
'numpy.ndarray[numpy.float64_t, ndim=2]'
)
self
.
assertEqual
(
inline
(
"return a[0,0]"
,
a
=
a
,
**
self
.
test_kwds
),
10.0
)
@
unittest
.
skipIf
(
not
has_numpy
,
"NumPy is not available"
)
def
test_numpy
(
self
):
import
numpy
a
=
numpy
.
ndarray
((
10
,
20
))
a
[
0
,
0
]
=
10
self
.
assertEqual
(
safe_type
(
a
),
'numpy.ndarray[numpy.float64_t, ndim=2]'
)
self
.
assertEqual
(
inline
(
"return a[0,0]"
,
a
=
a
,
**
self
.
test_kwds
),
10.0
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment