]> granicus.if.org Git - python/commitdiff
Make test_logging no longer fail if zlib not present. Closes #14256. Patch by Pedro...
authorEric V. Smith <eric@trueblade.com>
Mon, 12 Mar 2012 05:46:04 +0000 (22:46 -0700)
committerEric V. Smith <eric@trueblade.com>
Mon, 12 Mar 2012 05:46:04 +0000 (22:46 -0700)
Lib/test/test_logging.py
Misc/ACKS

index 98a28193b47aaa7ffb0d8570064c9070bd366411..be84be682f7173bcae3846e9c24ef842fe5d7b26 100644 (file)
@@ -39,14 +39,13 @@ import socket
 import struct
 import sys
 import tempfile
-from test.support import captured_stdout, run_with_locale, run_unittest, patch
-from test.support import TestHandler, Matcher
+from test.support import (captured_stdout, run_with_locale, run_unittest,
+                          patch, requires_zlib, TestHandler, Matcher)
 import textwrap
 import time
 import unittest
 import warnings
 import weakref
-import zlib
 try:
     import threading
     # The following imports are needed only for tests which
@@ -70,6 +69,10 @@ try:
 except ImportError:
     win32evtlogutil = None
     win32evtlog = None
+try:
+    import zlib
+except ImportError:
+    pass
 
 
 class BaseTest(unittest.TestCase):
@@ -3602,6 +3605,7 @@ class RotatingFileHandlerTest(BaseFileTest):
         self.assertFalse(os.path.exists(namer(self.fn + ".3")))
         rh.close()
 
+    @requires_zlib
     def test_rotator(self):
         def namer(name):
             return name + ".gz"
index 17ea9198fe99f1193a293c4af61773dbdee023cd..49efa297f7a5b1a81f25d6c22cb8c91fbb52c436 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -559,6 +559,7 @@ Holger Krekel
 Michael Kremer
 Fabian Kreutz
 Cédric Krier
+Pedro Kroger
 Hannu Krosing
 Andrej Krpic
 Ivan Krstić