diff options
| author | Eric V. Smith <eric@trueblade.com> | 2012-03-11 22:46:04 -0700 |
|---|---|---|
| committer | Eric V. Smith <eric@trueblade.com> | 2012-03-11 22:46:04 -0700 |
| commit | 851cad76164bb8ebc84937bfd14a7ea00e4911bc (patch) | |
| tree | e2072aa22e1007b3f37d43dec12253754b233dc5 /Lib/test/test_logging.py | |
| parent | b69ef16fe63e6de91c5d659bd83d9eff67b38d98 (diff) | |
| download | cpython-git-851cad76164bb8ebc84937bfd14a7ea00e4911bc.tar.gz | |
Make test_logging no longer fail if zlib not present. Closes #14256. Patch by Pedro Kroger.
Diffstat (limited to 'Lib/test/test_logging.py')
| -rw-r--r-- | Lib/test/test_logging.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 98a28193b4..be84be682f 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -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" |
