Skip to content

Commit 2956103

Browse files
committed
tests xfail on csv zip compression in Python 2
1 parent dd958ac commit 2956103

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pandas/tests/frame/test_to_csv.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from numpy import nan
99
import numpy as np
1010

11-
from pandas.compat import (lmap, range, lrange, StringIO, u)
11+
from pandas.compat import (lmap, range, lrange, StringIO, u, PY2)
1212
import pandas.core.common as com
1313
from pandas.errors import ParserError
1414
from pandas import (DataFrame, Index, Series, MultiIndex, Timestamp,
@@ -925,6 +925,10 @@ def test_to_csv_compression(self, compression):
925925
[12.32112, 123123.2, 321321.2]],
926926
index=['A', 'B'], columns=['X', 'Y', 'Z'])
927927

928+
if PY2 and compression == 'zip':
929+
pytest.xfail(reason='zip compression for csv not suppported in'
930+
'Python 2')
931+
928932
with ensure_clean() as filename:
929933

930934
df.to_csv(filename, compression=compression)

pandas/tests/series/test_io.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from pandas import Series, DataFrame
1212

13-
from pandas.compat import StringIO, u
13+
from pandas.compat import StringIO, u, PY2
1414
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
1515
assert_frame_equal, ensure_clean)
1616
import pandas.util.testing as tm
@@ -143,6 +143,10 @@ def test_to_csv_compression(self, compression):
143143
s = Series([0.123456, 0.234567, 0.567567], index=['A', 'B', 'C'],
144144
name='X')
145145

146+
if PY2 and compression == 'zip':
147+
pytest.xfail(reason='zip compression for csv not suppported in'
148+
'Python 2')
149+
146150
with ensure_clean() as filename:
147151

148152
s.to_csv(filename, compression=compression, header=True)

0 commit comments

Comments
 (0)