Fixed test to really work if numpy isn't installed.

This commit is contained in:
Davis King 2018-01-16 21:00:54 -05:00
parent a9ca83d228
commit 99b0f687b4
1 changed files with 18 additions and 17 deletions

View File

@ -7,9 +7,9 @@ from pytest import raises
try: try:
import numpy import numpy
have_numpy = True
except ImportError: except ImportError:
# Just skip these tests if numpy isn't installed have_numpy = False
exit(0)
def test_matrix_empty_init(): def test_matrix_empty_init():
@ -57,6 +57,7 @@ def test_matrix_from_list_as_column_vector():
assert str(m) == "0 \n1 \n2" assert str(m) == "0 \n1 \n2"
if have_numpy:
def test_matrix_from_object_with_2d_shape(): def test_matrix_from_object_with_2d_shape():
m1 = numpy.array([[0, 1, 2], m1 = numpy.array([[0, 1, 2],
[3, 4, 5], [3, 4, 5],