Skip to content

Commit 6e3b2b1

Browse files
committed
TST: xfail non-writeable pytables tests with numpy 1.16x
closes pandas-dev#25511
1 parent ae4db86 commit 6e3b2b1

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

pandas/tests/io/test_pytables.py

+28-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
tables = pytest.importorskip('tables')
3535

3636

37+
# TODO:
38+
# remove when gh-24839 is fixed; this affects numpy 1.16
39+
# and pytables 3.4.4
40+
xfail_non_writeable = pytest.mark.xfail(
41+
LooseVersion(np.__version__) >= LooseVersion('1.16'),
42+
reason=('gh-25511, gh-24839. pytables needs a '
43+
'release beyong 3.4.4 to support numpy 1.16x'))
44+
45+
3746
_default_compressor = ('blosc' if LooseVersion(tables.__version__) >=
3847
LooseVersion('2.2') else 'zlib')
3948

@@ -862,6 +871,7 @@ def test_put_integer(self):
862871
df = DataFrame(np.random.randn(50, 100))
863872
self._check_roundtrip(df, tm.assert_frame_equal)
864873

874+
@xfail_non_writeable
865875
def test_put_mixed_type(self):
866876
df = tm.makeTimeDataFrame()
867877
df['obj1'] = 'foo'
@@ -1438,7 +1448,10 @@ def test_to_hdf_with_min_itemsize(self):
14381448
tm.assert_series_equal(pd.read_hdf(path, 'ss4'),
14391449
pd.concat([df['B'], df2['B']]))
14401450

1441-
@pytest.mark.parametrize("format", ['fixed', 'table'])
1451+
@pytest.mark.parametrize(
1452+
"format",
1453+
[pytest.param('fixed', marks=xfail_non_writeable),
1454+
'table'])
14421455
def test_to_hdf_errors(self, format):
14431456

14441457
data = ['\ud800foo']
@@ -1815,6 +1828,7 @@ def test_pass_spec_to_storer(self):
18151828
pytest.raises(TypeError, store.select,
18161829
'df', where=[('columns=A')])
18171830

1831+
@xfail_non_writeable
18181832
def test_append_misc(self):
18191833

18201834
with ensure_clean_store(self.path) as store:
@@ -2006,6 +2020,7 @@ def test_unimplemented_dtypes_table_columns(self):
20062020
# this fails because we have a date in the object block......
20072021
pytest.raises(TypeError, store.append, 'df_unimplemented', df)
20082022

2023+
@xfail_non_writeable
20092024
@pytest.mark.skipif(
20102025
LooseVersion(np.__version__) == LooseVersion('1.15.0'),
20112026
reason=("Skipping pytables test when numpy version is "
@@ -2245,6 +2260,7 @@ def test_float_index(self):
22452260
s = Series(np.random.randn(10), index=index)
22462261
self._check_roundtrip(s, tm.assert_series_equal)
22472262

2263+
@xfail_non_writeable
22482264
def test_tuple_index(self):
22492265

22502266
# GH #492
@@ -2257,6 +2273,7 @@ def test_tuple_index(self):
22572273
simplefilter("ignore", pd.errors.PerformanceWarning)
22582274
self._check_roundtrip(DF, tm.assert_frame_equal)
22592275

2276+
@xfail_non_writeable
22602277
@pytest.mark.filterwarnings("ignore::pandas.errors.PerformanceWarning")
22612278
def test_index_types(self):
22622279

@@ -2320,6 +2337,7 @@ def test_timeseries_preepoch(self):
23202337
except OverflowError:
23212338
pytest.skip('known failer on some windows platforms')
23222339

2340+
@xfail_non_writeable
23232341
@pytest.mark.parametrize("compression", [
23242342
False, pytest.param(True, marks=td.skip_if_windows_python_3)
23252343
])
@@ -2350,6 +2368,7 @@ def test_frame(self, compression):
23502368
# empty
23512369
self._check_roundtrip(df[:0], tm.assert_frame_equal)
23522370

2371+
@xfail_non_writeable
23532372
def test_empty_series_frame(self):
23542373
s0 = Series()
23552374
s1 = Series(name='myseries')
@@ -2363,8 +2382,10 @@ def test_empty_series_frame(self):
23632382
self._check_roundtrip(df1, tm.assert_frame_equal)
23642383
self._check_roundtrip(df2, tm.assert_frame_equal)
23652384

2366-
def test_empty_series(self):
2367-
for dtype in [np.int64, np.float64, np.object, 'm8[ns]', 'M8[ns]']:
2385+
@xfail_non_writeable
2386+
@pytest.mark.parametrize(
2387+
'dtype', [np.int64, np.float64, np.object, 'm8[ns]', 'M8[ns]'])
2388+
def test_empty_series(self, dtype):
23682389
s = Series(dtype=dtype)
23692390
self._check_roundtrip(s, tm.assert_series_equal)
23702391

@@ -2445,6 +2466,7 @@ def test_store_series_name(self):
24452466
recons = store['series']
24462467
tm.assert_series_equal(recons, series)
24472468

2469+
@xfail_non_writeable
24482470
@pytest.mark.parametrize("compression", [
24492471
False, pytest.param(True, marks=td.skip_if_windows_python_3)
24502472
])
@@ -3954,6 +3976,7 @@ def test_pytables_native2_read(self, datapath):
39543976
d1 = store['detector']
39553977
assert isinstance(d1, DataFrame)
39563978

3979+
@xfail_non_writeable
39573980
def test_legacy_table_fixed_format_read_py2(self, datapath):
39583981
# GH 24510
39593982
# legacy table with fixed format written in Python 2
@@ -4117,6 +4140,7 @@ def test_unicode_longer_encoded(self):
41174140
result = store.get('df')
41184141
tm.assert_frame_equal(result, df)
41194142

4143+
@xfail_non_writeable
41204144
def test_store_datetime_mixed(self):
41214145

41224146
df = DataFrame(
@@ -4677,6 +4701,7 @@ def test_complex_table(self):
46774701
reread = read_hdf(path, 'df')
46784702
assert_frame_equal(df, reread)
46794703

4704+
@xfail_non_writeable
46804705
def test_complex_mixed_fixed(self):
46814706
complex64 = np.array([1.0 + 1.0j, 1.0 + 1.0j,
46824707
1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex64)

0 commit comments

Comments
 (0)