Skip to content

Commit ae7ecb0

Browse files
author
analyticalmonk
committed
TST: check for invalid dtype for Series constructor per GH15520
1 parent 73d980a commit ae7ecb0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/series/test_constructors.py

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030

3131
class TestSeriesConstructors(TestData, tm.TestCase):
3232

33+
def test_invalid_dtype(self):
34+
# GH15520
35+
msg = 'not understood'
36+
invalid_list = [pd.Timestamp, 'pd.Timestamp', list]
37+
for dtype in invalid_list:
38+
with tm.assertRaisesRegexp(TypeError, msg):
39+
Series([], name='time', dtype=pd.Timestamp)
40+
3341
def test_scalar_conversion(self):
3442

3543
# Pass in scalar is disabled

0 commit comments

Comments
 (0)