Skip to content
Myr

test_bytecode_cache.py

This file

Path

tests/test_bytecode_cache.py

32 lines · 820 bytes · Python

Last changed by

Bump up the copyright to 2017Armin Ronacherbefore adoptionbbe0a41

History of this file

Take it

Merge branch 'lkarthee-pytest_migration'Markus Unterwaditzerbefore adoption1c5f1e8

lines 1–7why, one step back
1# -*- coding: utf-8 -*-
2"""3 jinja2.testsuite.bytecode_cache4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~56 Test bytecode caching7

Bump up the copyright to 2017Armin Ronacherbefore adoptionbbe0a41

line 8why, one step back
8 :copyright: (c) 2017 by the Jinja Team.

Merge branch 'lkarthee-pytest_migration'Markus Unterwaditzerbefore adoption1c5f1e8

lines 9–26why, one step back
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_cache

Cleaned up shitty syntax in testsuiteArmin Ronacherbefore adoption73e2b51

line 27why, one step back
27class TestByteCodeCache(object):

Merge branch 'lkarthee-pytest_migration'Markus Unterwaditzerbefore adoption1c5f1e8

lines 28–32why, one step back
28
29 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')