Skip to content

Commit 50f5277

Browse files
committed
TST: skip compression tests if either gzip/bz2 not built with user's python. close #2424
1 parent 36ef227 commit 50f5277

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/io/tests/test_parsers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,12 +1799,14 @@ def test_pure_python_failover(self):
17991799
tm.assert_frame_equal(result, expected)
18001800

18011801
def test_decompression(self):
1802-
data = open(self.csv1, 'rb').read()
1802+
try:
1803+
import gzip, bz2
1804+
except ImportError:
1805+
raise nose.SkipTest
18031806

1807+
data = open(self.csv1, 'rb').read()
18041808
expected = self.read_csv(self.csv1)
18051809

1806-
import gzip, bz2
1807-
18081810
try:
18091811
tmp = gzip.GzipFile('__tmp__', mode='wb')
18101812
tmp.write(data)

0 commit comments

Comments
 (0)