[Python-checkins] cpython: Skip test in test_fileinput when zlib is missing.
ezio.melotti
python-checkins at python.org
Sat May 14 09:11:05 CEST 2011
http://hg.python.org/cpython/rev/e0b4ed75b8e7
changeset: 70096:e0b4ed75b8e7
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Sat May 14 10:10:53 2011 +0300
summary:
Skip test in test_fileinput when zlib is missing.
files:
Lib/test/test_fileinput.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -7,7 +7,6 @@
import re
import fileinput
import collections
-import gzip
import types
import codecs
import unittest
@@ -16,6 +15,10 @@
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 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list