test_bytecode_cache.py
This file
Path
tests/test_bytecode_cache.py
32 lines · 814 bytes · Python
Last changed by
Merge branch 'lkarthee-pytest_migration'Markus Unterwaditzerbefore adoption1c5f1e8
History of this fileTake it
1# -*- coding: utf-8 -*-2"""3 jinja2.testsuite.bytecode_cache4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~56 Test bytecode caching78 :copyright: (c) 2010 by the Jinja Team.9 :license: BSD, see LICENSE for more details.10"""11import pytest12from jinja2 import Environment13from jinja2.bccache import FileSystemBytecodeCache14from jinja2.exceptions import TemplateNotFound151617@pytest.fixture18def env(package_loader):19 bytecode_cache = FileSystemBytecodeCache()20 return Environment(21 loader=package_loader,22 bytecode_cache=bytecode_cache,23 )242526@pytest.mark.byte_code_cache27class TestByteCodeCache():2829 def test_simple(self, env):30 tmpl = env.get_template('test.html')31 assert tmpl.render().strip() == 'BAR'32 pytest.raises(TemplateNotFound, env.get_template, 'missing.html')