Commit 851cad76 authored by Eric V. Smith's avatar Eric V. Smith

Make test_logging no longer fail if zlib not present. Closes #14256. Patch by Pedro Kroger.

parent b69ef16f
...@@ -39,14 +39,13 @@ import socket ...@@ -39,14 +39,13 @@ import socket
import struct import struct
import sys import sys
import tempfile import tempfile
from test.support import captured_stdout, run_with_locale, run_unittest, patch from test.support import (captured_stdout, run_with_locale, run_unittest,
from test.support import TestHandler, Matcher patch, requires_zlib, TestHandler, Matcher)
import textwrap import textwrap
import time import time
import unittest import unittest
import warnings import warnings
import weakref import weakref
import zlib
try: try:
import threading import threading
# The following imports are needed only for tests which # The following imports are needed only for tests which
...@@ -70,6 +69,10 @@ try: ...@@ -70,6 +69,10 @@ try:
except ImportError: except ImportError:
win32evtlogutil = None win32evtlogutil = None
win32evtlog = None win32evtlog = None
try:
import zlib
except ImportError:
pass
class BaseTest(unittest.TestCase): class BaseTest(unittest.TestCase):
...@@ -3602,6 +3605,7 @@ class RotatingFileHandlerTest(BaseFileTest): ...@@ -3602,6 +3605,7 @@ class RotatingFileHandlerTest(BaseFileTest):
self.assertFalse(os.path.exists(namer(self.fn + ".3"))) self.assertFalse(os.path.exists(namer(self.fn + ".3")))
rh.close() rh.close()
@requires_zlib
def test_rotator(self): def test_rotator(self):
def namer(name): def namer(name):
return name + ".gz" return name + ".gz"
......
...@@ -559,6 +559,7 @@ Holger Krekel ...@@ -559,6 +559,7 @@ Holger Krekel
Michael Kremer Michael Kremer
Fabian Kreutz Fabian Kreutz
Cédric Krier Cédric Krier
Pedro Kroger
Hannu Krosing Hannu Krosing
Andrej Krpic Andrej Krpic
Ivan Krstić Ivan Krstić
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment