Skip to content

Commit 4dc2ef8

Browse files
committed
TST: separate out test_append_to_multiple_dropna to two tests; when drop=False this is sometimes failing
1 parent 9a34010 commit 4dc2ef8

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

pandas/tests/io/test_pytables.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4049,6 +4049,7 @@ def test_append_to_multiple_dropna(self):
40494049
df = concat([df1, df2], axis=1)
40504050

40514051
with ensure_clean_store(self.path) as store:
4052+
40524053
# dropna=True should guarantee rows are synchronized
40534054
store.append_to_multiple(
40544055
{'df1': ['A', 'B'], 'df2': None}, df, selector='df1',
@@ -4059,14 +4060,27 @@ def test_append_to_multiple_dropna(self):
40594060
tm.assert_index_equal(store.select('df1').index,
40604061
store.select('df2').index)
40614062

4063+
@pytest.mark.xfail(run=False,
4064+
reason="append_to_multiple_dropna_false "
4065+
"is not raising as failed")
4066+
def test_append_to_multiple_dropna_false(self):
4067+
df1 = tm.makeTimeDataFrame()
4068+
df2 = tm.makeTimeDataFrame().rename(columns=lambda x: "%s_2" % x)
4069+
df1.iloc[1, df1.columns.get_indexer(['A', 'B'])] = np.nan
4070+
df = concat([df1, df2], axis=1)
4071+
4072+
with ensure_clean_store(self.path) as store:
4073+
40624074
# dropna=False shouldn't synchronize row indexes
40634075
store.append_to_multiple(
4064-
{'df1': ['A', 'B'], 'df2': None}, df, selector='df1',
4076+
{'df1a': ['A', 'B'], 'df2a': None}, df, selector='df1a',
40654077
dropna=False)
4066-
self.assertRaises(
4067-
ValueError, store.select_as_multiple, ['df1', 'df2'])
4068-
assert not store.select('df1').index.equals(
4069-
store.select('df2').index)
4078+
4079+
with pytest.raises(ValueError):
4080+
store.select_as_multiple(['df1a', 'df2a'])
4081+
4082+
assert not store.select('df1a').index.equals(
4083+
store.select('df2a').index)
40704084

40714085
def test_select_as_multiple(self):
40724086

0 commit comments

Comments
 (0)