summaryrefslogtreecommitdiff
path: root/test/test_template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-13 17:33:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-13 17:33:33 -0400
commit9262cac6a62a96e6bc8235a1ff95d4dde5820722 (patch)
treed779cc4fc92995e7eaa0202f85562a3cfaab1628 /test/test_template.py
parent8cce6101ac97aa59023f23185a5e1160330a93be (diff)
downloadmako-9262cac6a62a96e6bc8235a1ff95d4dde5820722.tar.gz
- remove context manager to allow 2.5 and 2.4 to work, [ticket:188]
- add conditionals to pygments-dependent tests that ensure pygments 1.4, separate check for no pygments.
Diffstat (limited to 'test/test_template.py')
-rw-r--r--test/test_template.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_template.py b/test/test_template.py
index 6a617ef..a1ab11e 100644
--- a/test/test_template.py
+++ b/test/test_template.py
@@ -873,6 +873,7 @@ class ControlTest(TemplateTest):
filters=lambda s:s.strip()
)
+ @skip_if(lambda: not util.py26)
def test_blank_control_8(self):
self._do_memory_test(
"""
@@ -970,6 +971,7 @@ class ControlTest(TemplateTest):
filters=lambda s:s.strip()
)
+ @skip_if(lambda: not util.py26)
def test_commented_blank_control_8(self):
self._do_memory_test(
"""
@@ -1093,9 +1095,10 @@ class ModuleDirTest(TemplateTest):
def test_custom_writer(self):
canary = []
def write_module(source, outputpath):
- with open(outputpath, 'wb') as f:
- canary.append(outputpath)
- f.write(source)
+ f = open(outputpath, 'wb')
+ canary.append(outputpath)
+ f.write(source)
+ f.close()
lookup = TemplateLookup(template_base, module_writer=write_module,
module_directory=module_base)
t = lookup.get_template('/modtest.html')