Skip to content

Commit b586d41

Browse files
authored
Import and use unittest
1 parent 967d49e commit b586d41

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

symengine/tests/test_matrices.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
Rational, function_symbol, I, NonSquareMatrixError, ShapeError, zeros,
44
ones, eye, ImmutableMatrix)
55
from symengine.test_utilities import raises
6+
import unittest
67

78

89
try:
910
import numpy as np
10-
HAVE_NUMPY = True
11+
have_numpy = True
1112
except ImportError:
12-
HAVE_NUMPY = False
13+
have_numpy = False
1314

1415
try:
1516
import sympy
@@ -529,21 +530,18 @@ def test_reshape():
529530
assert C != A
530531

531532

532-
# @pytest.mark.skipif(not HAVE_NUMPY, reason='requires numpy')
533+
@unittest.skipIf(not have_numpy, 'requires numpy')
533534
def test_dump_real():
534-
if not HAVE_NUMPY: # nosetests work-around
535-
return
536535
ref = [1, 2, 3, 4]
537536
A = DenseMatrix(2, 2, ref)
538537
out = np.empty(4)
539538
A.dump_real(out)
540539
assert np.allclose(out, ref)
541540

542541

543-
# @pytest.mark.skipif(not HAVE_NUMPY, reason='requires numpy')
542+
543+
@unittest.skipIf(not have_numpy, 'requires numpy')
544544
def test_dump_complex():
545-
if not HAVE_NUMPY: # nosetests work-around
546-
return
547545
ref = [1j, 2j, 3j, 4j]
548546
A = DenseMatrix(2, 2, ref)
549547
out = np.empty(4, dtype=np.complex128)

0 commit comments

Comments
 (0)