From 8a28cd0fb5850a7fe0a0fb25cb5fcdbde560f472 Mon Sep 17 00:00:00 2001 From: Lucas Tan Date: Sat, 5 Apr 2014 19:02:56 +0800 Subject: [PATCH] drop support for Jinja2 for Python 3.2 --- compressor/tests/test_offline.py | 9 ++++++--- tox.ini | 14 ++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/compressor/tests/test_offline.py b/compressor/tests/test_offline.py index 5df0f0d..dd9b9e5 100644 --- a/compressor/tests/test_offline.py +++ b/compressor/tests/test_offline.py @@ -25,6 +25,8 @@ else: except ImportError: from StringIO import StringIO +_TEST_JINJA2 = not(sys.version_info.major == 3 and sys.version_info.minor == 2) + class OfflineTestCaseMixin(object): template_name = "test_compressor_offline.html" @@ -33,10 +35,10 @@ class OfflineTestCaseMixin(object): templates_dir = "" expected_hash = "" # Engines to test - if sys.version_info.major == 3 and sys.version_info.minor == 2: - engines = ("django",) - else: + if _TEST_JINJA2: engines = ("django", "jinja2") + else: + engines = ("django",) def setUp(self): self._old_compress = settings.COMPRESS_ENABLED @@ -288,6 +290,7 @@ class OfflineGenerationTestCase(OfflineTestCaseMixin, TestCase): self.assertRaises(OfflineGenerationError, self.template.render, Context({})) + @unittest.skipUnless(_TEST_JINJA2, "No Jinja2 testing") def test_rendering_without_manifest_raises_exception_jinja2(self): # flush cached manifest flush_offline_manifest() diff --git a/tox.ini b/tox.ini index 1aa5e81..08ce2aa 100644 --- a/tox.ini +++ b/tox.ini @@ -20,16 +20,6 @@ three = BeautifulSoup4 jingo coffin -three_two = - flake8 - coverage - html5lib - mock - jinja2==2.6 - lxml - BeautifulSoup4 - jingo - coffin [tox] envlist = @@ -64,7 +54,7 @@ deps = basepython = python3.2 deps = Django>=1.6,<1.7 - {[deps]three_two} + {[deps]three} [testenv:py27-1.6.X] basepython = python2.7 @@ -90,7 +80,7 @@ basepython = python3.2 deps = Django>=1.5,<1.6 django-discover-runner - {[deps]three_two} + {[deps]three} [testenv:py27-1.5.X] basepython = python2.7