Skip to content

Commit

Permalink
Add test for missing scipy importerror
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Jul 1, 2024
1 parent b1f6fdb commit e65f760
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit/common/test_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
SCIPY_INSTALLED = False


class TestCSRMatrixNoScipy(TestCase):

def test_import_error(self):
data = np.array([[1, 0, 2], [0, 0, 3], [4, 5, 6]])
with self.assertRaises(ImportError):
CSRMatrix(data=data)


@unittest.skipIf(not SCIPY_INSTALLED, "scipy is not installed")
class TestCSRMatrix(TestCase):

Expand Down

0 comments on commit e65f760

Please sign in to comment.