Skip to content

Commit

Permalink
Import and use unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf authored Mar 20, 2023
1 parent 967d49e commit b586d41
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions symengine/tests/test_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
Rational, function_symbol, I, NonSquareMatrixError, ShapeError, zeros,
ones, eye, ImmutableMatrix)
from symengine.test_utilities import raises
import unittest


try:
import numpy as np
HAVE_NUMPY = True
have_numpy = True
except ImportError:
HAVE_NUMPY = False
have_numpy = False

try:
import sympy
Expand Down Expand Up @@ -529,21 +530,18 @@ def test_reshape():
assert C != A


# @pytest.mark.skipif(not HAVE_NUMPY, reason='requires numpy')
@unittest.skipIf(not have_numpy, 'requires numpy')
def test_dump_real():
if not HAVE_NUMPY: # nosetests work-around
return
ref = [1, 2, 3, 4]
A = DenseMatrix(2, 2, ref)
out = np.empty(4)
A.dump_real(out)
assert np.allclose(out, ref)


# @pytest.mark.skipif(not HAVE_NUMPY, reason='requires numpy')

@unittest.skipIf(not have_numpy, 'requires numpy')
def test_dump_complex():
if not HAVE_NUMPY: # nosetests work-around
return
ref = [1j, 2j, 3j, 4j]
A = DenseMatrix(2, 2, ref)
out = np.empty(4, dtype=np.complex128)
Expand Down

0 comments on commit b586d41

Please sign in to comment.