Skip to content

Commit 47e1680

Browse files
author
analyticalmonk
committed
added more test-cases for pandas_dtype() test
1 parent 556a0e6 commit 47e1680

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/dtypes/test_common.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ class TestPandasDtype(tm.TestCase):
1717
# Passing invalid dtype, both as a string or object, must raise TypeError
1818
def test_invalid_dtype_error(self):
1919
msg = 'not understood'
20-
for dtype in [pd.Timestamp, 'time']:
20+
invalid_list = [pd.Timestamp, 'pd.Timestamp']
21+
for dtype in invalid_list:
2122
with tm.assertRaisesRegexp(TypeError, msg):
2223
pandas_dtype(dtype)
2324

25+
valid_list = [object, 'float64', np.float64, float, np.dtype('float64')]
26+
for dtype in valid_list:
27+
pandas_dtype(dtype)
28+
2429
def test_numpy_dtype(self):
2530
for dtype in ['M8[ns]', 'm8[ns]', 'object', 'float64', 'int64']:
2631
self.assertEqual(pandas_dtype(dtype), np.dtype(dtype))

0 commit comments

Comments
 (0)