Skip to content

Commit 16e21fd

Browse files
committed
TST: invalid construction of Series() from list of len != len(index)
1 parent 9640482 commit 16e21fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tests/series/test_constructors.py

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def test_scalar_conversion(self):
5050
assert int(Series([1.])) == 1
5151
assert long(Series([1.])) == 1
5252

53+
@pytest.mark.parametrize('scalar', [1, 'abc', {2, 3}])
54+
@pytest.mark.parametrize('index', [range(2), ['a', 'b']])
55+
def test_invalid_1_dimensional(self, scalar, index):
56+
pytest.raises(ValueError, Series, [scalar], index=index)
57+
5358
def test_constructor(self):
5459
assert self.ts.index.is_all_dates
5560

0 commit comments

Comments
 (0)