summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorbriancurtin <brian.curtin@gmail.com>2011-03-18 18:03:17 (GMT)
committerbriancurtin <brian.curtin@gmail.com>2011-03-18 18:03:17 (GMT)
commitf84f3c3d2dd02fa667ee8c89b9285e72a0d25aac (patch)
treef1c6694a3fcaa87892363e3bbb67c5e3df1a97a2 /Lib
parent6827294e0501096fe99da1cf7fc92397e6939502 (diff)
downloadcpython-f84f3c3d2dd02fa667ee8c89b9285e72a0d25aac.zip
cpython-f84f3c3d2dd02fa667ee8c89b9285e72a0d25aac.tar.gz
cpython-f84f3c3d2dd02fa667ee8c89b9285e72a0d25aac.tar.bz2
Fix #11596. When bz2 isn't available, skip test_bz2_ext_fake.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_fileinput.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index 27ceaf6..76e4d16 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -8,11 +8,15 @@ import re
import fileinput
import collections
import gzip
-import bz2
import types
import codecs
import unittest
+try:
+ import bz2
+except ImportError:
+ bz2 = None
+
from io import StringIO
from fileinput import FileInput, hook_encoded
@@ -765,6 +769,7 @@ class Test_hook_compressed(unittest.TestCase):
self.assertEqual(self.fake_open.invocation_count, 1)
self.assertEqual(self.fake_open.last_invocation, (("test.gz", 3), {}))
+ @unittest.skipUnless(bz2, "Requires bz2")
def test_bz2_ext_fake(self):
original_open = bz2.BZ2File
bz2.BZ2File = self.fake_open