From 083a78095433193a05bb826de9b93ce31a0193df Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 15 Feb 2011 15:06:13 +0100 Subject: [PATCH] Don't show warning if lxml is not installed. --- compressor/tests/tests.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compressor/tests/tests.py b/compressor/tests/tests.py index 04e2be2a1..bb416b303 100644 --- a/compressor/tests/tests.py +++ b/compressor/tests/tests.py @@ -2,6 +2,11 @@ import re from BeautifulSoup import BeautifulSoup +try: + import lxml +except ImportError: + lxml = None + from django.core.cache.backends import dummy from django.core.files.storage import get_storage_class from django.template import Template, Context, TemplateSyntaxError @@ -111,13 +116,7 @@ def test_custom_output_dir(self): self.assertEqual(output, JsCompressor(self.js).output()) settings.COMPRESS_OUTPUT_DIR = old_output_dir - -try: - import lxml -except ImportError: - import warnings - warnings.warn("lxml library couldn't be found, skipping tests.") -else: +if lxml: class LxmlCompressorTestCase(CompressorTestCase): def test_css_split(self):