summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileinput.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-05-14 07:10:53 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2011-05-14 07:10:53 (GMT)
commitc3afbb95425b42de348ec4b0430f954a37d6ce20 (patch)
treebc6cd8174036018e25319eadc5f2a451ef832803 /Lib/test/test_fileinput.py
parent6b71811469406c4b18a06439d85b93b290de8edb (diff)
downloadcpython-c3afbb95425b42de348ec4b0430f954a37d6ce20.zip
cpython-c3afbb95425b42de348ec4b0430f954a37d6ce20.tar.gz
cpython-c3afbb95425b42de348ec4b0430f954a37d6ce20.tar.bz2
Skip test in test_fileinput when zlib is missing.
Diffstat (limited to 'Lib/test/test_fileinput.py')
-rw-r--r--Lib/test/test_fileinput.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index 76e4d16..a96d48a 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -7,7 +7,6 @@ import sys
import re
import fileinput
import collections
-import gzip
import types
import codecs
import unittest
@@ -16,6 +15,10 @@ try:
import bz2
except ImportError:
bz2 = None
+try:
+ import gzip
+except ImportError:
+ gzip = None
from io import StringIO
from fileinput import FileInput, hook_encoded
@@ -758,6 +761,7 @@ class Test_hook_compressed(unittest.TestCase):
def test_no_ext(self):
self.do_test_use_builtin_open("abcd", 2)
+ @unittest.skipUnless(gzip, "Requires gzip and zlib")
def test_gz_ext_fake(self):
original_open = gzip.open
gzip.open = self.fake_open