Skip to content

Commit efc846d

Browse files
Move tests
1 parent d620c51 commit efc846d

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

pandas/tests/indexes/test_base.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2821,11 +2821,3 @@ def test_shape_of_invalid_index():
28212821

28222822
idx = pd.Index([0, 1, 2, 3])
28232823
assert idx[:, None].shape == (4, 1)
2824-
2825-
2826-
def test_index_construction_respects_dtype():
2827-
index_list = [7606741985629028552, 17876870360202815256]
2828-
expected = np.asarray(index_list, dtype="uint64")
2829-
result = np.asarray(UInt64Index(index_list, dtype="uint64"), dtype="uint64")
2830-
2831-
tm.assert_equal(expected, result)

pandas/tests/indexes/test_numeric.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,11 @@ def test_constructor(self):
944944
res = Index(np.array([-1, 2 ** 63], dtype=object))
945945
tm.assert_index_equal(res, idx)
946946

947+
# https://github.com/pandas-dev/pandas/issues/29526
948+
idx = pd.UInt64Index([1, 2**63 + 1])
949+
res = pd.UInt64Index(np.array([1, 2**63 + 1], dtype="uint64"))
950+
tm.assert_index_equal(res, idx)
951+
947952
def test_get_indexer(self, index_large):
948953
target = UInt64Index(np.arange(10).astype("uint64") * 5 + 2 ** 63)
949954
indexer = index_large.get_indexer(target)
@@ -1187,3 +1192,13 @@ def test_range_float_union_dtype():
11871192

11881193
result = other.union(index)
11891194
tm.assert_index_equal(result, expected)
1195+
1196+
1197+
def test_index_construction_respects_dtype():
1198+
# https://github.com/pandas-dev/pandas/issues/29526
1199+
index_list = [1, 2**63 + 1]
1200+
1201+
result = UInt64Index(index_list)
1202+
expected = UInt64Index(np.array(index_list, dtype="uint64"))
1203+
1204+
tm.assert_equal(expected, result)

0 commit comments

Comments
 (0)