Skip to content

Commit

Permalink
CLN: Remove import exception handling (#17218)
Browse files Browse the repository at this point in the history
Imports should succeed on all versions of Python that pandas supports.
  • Loading branch information
dhimmel authored and gfyoung committed Aug 10, 2017
1 parent f165b90 commit a2c4543
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions pandas/tests/io/parser/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
class CompressionTests(object):

def test_zip(self):
try:
import zipfile
except ImportError:
pytest.skip('need zipfile to run')
import zipfile

with open(self.csv1, 'rb') as data_file:
data = data_file.read()
Expand Down Expand Up @@ -65,10 +62,7 @@ def test_zip(self):
f, compression='zip')

def test_gzip(self):
try:
import gzip
except ImportError:
pytest.skip('need gzip to run')
import gzip

with open(self.csv1, 'rb') as data_file:
data = data_file.read()
Expand All @@ -94,10 +88,7 @@ def test_gzip(self):
tm.assert_frame_equal(result, expected)

def test_bz2(self):
try:
import bz2
except ImportError:
pytest.skip('need bz2 to run')
import bz2

with open(self.csv1, 'rb') as data_file:
data = data_file.read()
Expand Down

0 comments on commit a2c4543

Please sign in to comment.