Skip to content

Commit 36cb3c3

Browse files
author
Trevor Bye
committed
initial test case
1 parent a51a562 commit 36cb3c3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pytest
2+
import numpy as np
3+
import pandas as pd
4+
import pandas._testing as tm
5+
6+
7+
@pytest.mark.parametrize('test_dtype', [object, 'int8', 'int16', 'int32', 'int64'])
8+
def test_dtypes(test_dtype):
9+
df = pd.DataFrame({'A': pd.Series([1, 2, 3], dtype=test_dtype), 'B': [1, 2, 3]})
10+
expected = df.dtypes.values[0].type
11+
12+
df.set_index('A')
13+
result = df.index.dtype.type
14+
tm.assert_equal(result, expected)

0 commit comments

Comments
 (0)