Skip to content

Commit 7b683f4

Browse files
Use right assert raises (#20906)
Closes #20904
1 parent b020891 commit 7b683f4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/tests/io/test_pytables.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -4877,15 +4877,17 @@ def test_to_hdf_with_object_column_names(self):
48774877
if compat.PY3:
48784878
types_should_run.append(tm.makeUnicodeIndex)
48794879
else:
4880-
types_should_fail.append(tm.makeUnicodeIndex)
4880+
# TODO: Add back to types_should_fail
4881+
# https://github.com/pandas-dev/pandas/issues/20907
4882+
pass
48814883

48824884
for index in types_should_fail:
48834885
df = DataFrame(np.random.randn(10, 2), columns=index(2))
48844886
with ensure_clean_path(self.path) as path:
48854887
with catch_warnings(record=True):
4886-
with pytest.raises(
4887-
ValueError, msg=("cannot have non-object label "
4888-
"DataIndexableCol")):
4888+
with tm.assert_raises_regex(
4889+
ValueError, ("cannot have non-object label "
4890+
"DataIndexableCol")):
48894891
df.to_hdf(path, 'df', format='table',
48904892
data_columns=True)
48914893

0 commit comments

Comments
 (0)