Skip to content

Commit 0eca935

Browse files
committed
pylint fixes, new test
1 parent 2b9ac4a commit 0eca935

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/tests/frame/test_alter_axes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,9 @@ def test_dti_set_index_reindex(self):
394394

395395
def test_set_index_tuple(self):
396396
# test for fix of issue #15457, where the following raised a TypeError
397-
df = DataFrame([[2, 1, 2], [4, (1, 2), 3]]).set_index([0, 1])
398-
assert df.to_dict() == {2: {(2, 1): 2, (4, (1, 2)): 3}}
397+
expected = pd.DataFrame([[2, 1], [4, (1, 2)]]).set_index([0, 1]).index
398+
result = pd.MultiIndex.from_tuples([(2, 1), (4, (1, 2))], names=(0, 1))
399+
tm.assert_index_equal(expected, result)
399400

400401
# Renaming
401402

pandas/tests/indexes/multi/test_constructor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,3 @@ def test_tuples_with_name_string():
463463
pd.Index(li, name='abc')
464464
with pytest.raises(ValueError):
465465
pd.Index(li, name='a')
466-

0 commit comments

Comments
 (0)