There was an error while loading. Please reload this page.
1 parent 858e6b1 commit cfc0404Copy full SHA for cfc0404
1 file changed
tests/test_sparse_vector.py
@@ -26,6 +26,10 @@ def test_list(self) -> None:
26
def test_list_empty(self) -> None:
27
assert SparseVector([]).to_list() == []
28
29
+ def test_list_str(self) -> None:
30
+ with pytest.raises(ValueError, match='could not convert string to float') as error:
31
+ SparseVector([1, 'two', 3]) # type: ignore
32
+
33
def test_list_dimensions(self) -> None:
34
with pytest.raises(ValueError) as error:
35
SparseVector([1, 0, 2, 0, 3, 0], 6) # type: ignore
0 commit comments