Skip to content

Commit

Permalink
Don't show warning if lxml is not installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Feb 15, 2011
1 parent fa08781 commit 083a780
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions compressor/tests/tests.py
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 083a780

Please sign in to comment.