Skip to content

Commit

Permalink
TST: Update tests in multi for new return
Browse files Browse the repository at this point in the history
Previously these relied worked around the return type by wrapping list-likes
in `np.array` and relying on that to cast to float. These workarounds are no
longer nescessary.
  • Loading branch information
TomAugspurger committed Aug 14, 2017
1 parent 6016720 commit 273e6c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pandas/tests/indexes/test_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def test_from_arrays_empty(self):
arrays = [[]] * N
names = list('ABC')[:N]
result = MultiIndex.from_arrays(arrays=arrays, names=names)
expected = MultiIndex(levels=[np.array([])] * N, labels=[[]] * N,
expected = MultiIndex(levels=[[]] * N, labels=[[]] * N,
names=names)
tm.assert_index_equal(result, expected)

Expand Down Expand Up @@ -829,7 +829,7 @@ def test_from_product_empty(self):

# 1 level
result = MultiIndex.from_product([[]], names=['A'])
expected = pd.Float64Index([], name='A')
expected = pd.Index([], name='A')
tm.assert_index_equal(result, expected)

# 2 levels
Expand All @@ -838,7 +838,7 @@ def test_from_product_empty(self):
names = ['A', 'B']
for first, second in zip(l1, l2):
result = MultiIndex.from_product([first, second], names=names)
expected = MultiIndex(levels=[np.array(first), np.array(second)],
expected = MultiIndex(levels=[first, second],
labels=[[], []], names=names)
tm.assert_index_equal(result, expected)

Expand All @@ -847,8 +847,7 @@ def test_from_product_empty(self):
for N in range(4):
lvl2 = lrange(N)
result = MultiIndex.from_product([[], lvl2, []], names=names)
expected = MultiIndex(levels=[np.array(A)
for A in [[], lvl2, []]],
expected = MultiIndex(levels=[[], lvl2, []],
labels=[[], [], []], names=names)
tm.assert_index_equal(result, expected)

Expand Down

0 comments on commit 273e6c8

Please sign in to comment.