Skip to content

Commit

Permalink
Use right assert raises (#20906)
Browse files Browse the repository at this point in the history
Closes #20904
  • Loading branch information
TomAugspurger authored May 1, 2018
1 parent b020891 commit 7b683f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4877,15 +4877,17 @@ def test_to_hdf_with_object_column_names(self):
if compat.PY3:
types_should_run.append(tm.makeUnicodeIndex)
else:
types_should_fail.append(tm.makeUnicodeIndex)
# TODO: Add back to types_should_fail
# https://github.com/pandas-dev/pandas/issues/20907
pass

for index in types_should_fail:
df = DataFrame(np.random.randn(10, 2), columns=index(2))
with ensure_clean_path(self.path) as path:
with catch_warnings(record=True):
with pytest.raises(
ValueError, msg=("cannot have non-object label "
"DataIndexableCol")):
with tm.assert_raises_regex(
ValueError, ("cannot have non-object label "
"DataIndexableCol")):
df.to_hdf(path, 'df', format='table',
data_columns=True)

Expand Down

0 comments on commit 7b683f4

Please sign in to comment.