Skip to content

Commit

Permalink
Add test for single-element list and index case
Browse files Browse the repository at this point in the history
  • Loading branch information
cbertinato committed Feb 26, 2018
1 parent 29d9519 commit e756c7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/tests/series/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ def test_constructor_numpy_scalar(self):
expected = Series(100, index=np.arange(4), dtype='int64')
tm.assert_series_equal(result, expected)

def test_constructor_broadcast_list(self):
# GH 19342
# construction with single-element container and index
# should not raise
result = Series(['foo'], index=['a', 'b', 'c'])
expected = Series(['foo'] * 3, index=['a', 'b', 'c'])
tm.assert_series_equal(result, expected)

def test_constructor_corner(self):
df = tm.makeTimeDataFrame()
objs = [df, df]
Expand Down

0 comments on commit e756c7e

Please sign in to comment.