Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
99b0f687
Commit
99b0f687
authored
Jan 17, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test to really work if numpy isn't installed.
parent
a9ca83d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
test_matrix.py
tools/python/test/test_matrix.py
+5
-4
No files found.
tools/python/test/test_matrix.py
View file @
99b0f687
...
...
@@ -7,9 +7,9 @@ from pytest import raises
try
:
import
numpy
have_numpy
=
True
except
ImportError
:
# Just skip these tests if numpy isn't installed
exit
(
0
)
have_numpy
=
False
def
test_matrix_empty_init
():
...
...
@@ -57,7 +57,8 @@ def test_matrix_from_list_as_column_vector():
assert
str
(
m
)
==
"0
\n
1
\n
2"
def
test_matrix_from_object_with_2d_shape
():
if
have_numpy
:
def
test_matrix_from_object_with_2d_shape
():
m1
=
numpy
.
array
([[
0
,
1
,
2
],
[
3
,
4
,
5
],
[
6
,
7
,
8
]])
...
...
@@ -70,7 +71,7 @@ def test_matrix_from_object_with_2d_shape():
assert
str
(
m
)
==
"0 1 2
\n
3 4 5
\n
6 7 8"
def
test_matrix_from_object_without_2d_shape
():
def
test_matrix_from_object_without_2d_shape
():
with
raises
(
IndexError
):
m1
=
numpy
.
array
([
0
,
1
,
2
])
matrix
(
m1
)
...
...
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