[pypy-issue] [issue1173] call to get_template() in pypy's doctest can't find template

Ian Delaney tracker at bugs.pypy.org
Tue Jun 12 19:53:54 CEST 2012

New submission from Ian Delaney <della5 at iinet.com.au>:

1 single failed test in the 277 tests of jinja's testsuite. (-2.6)
Remember I am quite the pypy novice so I can't interpret this error as yet.
I would like to offer a better insight, but am relying on devs here.

FileSystemBytecodeCache (jinja2.bccache)
Doctest: jinja2.bccache.FileSystemBytecodeCache ... ok

ERROR: test_byte_compilation (jinja2.testsuite.loader.ModuleLoaderTestCase)
Traceback (most recent call last):
line 180, in test_byte_compilation
    tmpl1 = self.mod_env.get_template('a/test.html')
line 719, in get_template
    return self._load_template(name, self.make_globals(globals))
line 693, in _load_template
    template = self.loader.load(self, name, globals)
line 443, in load
    raise TemplateNotFound(name)
TemplateNotFound: a/test.html

Ran 277 tests in 4.204s

here are located 2 test.html files.
archtester jinja # find 
/mnt/gen2/TmpDir/portage/dev-python/jinja-2.6/work/Jinja2-2.6/jinja2/ -name

here is the test

    def test_byte_compilation(self):
        log = self.compile_down(py_compile=True)
        assert 'Byte-compiled "a/test.html"' in log
        tmpl1 = self.mod_env.get_template('a/test.html')
        mod = self.mod_env.loader.module. \
       assert mod.__file__.endswith('.pyc')

Now I have no idea of what a/ represents in python, but it seems it can't be a
folder a/ since there is not one of them.  line 180, in test_byte_compilation
points to 

tmpl1 = self.mod_env.get_template('a/test.html')
python2s pass this test no issue. The test is testing  byte_compilation but I
suppose it never gets far enough to test it not finding the template file.

Included the file Jinja2-2.6/jinja2/testsuite/loader.py which hosts the test.


files: loader.py
messages: 4433
nosy: idella5, pypy-issue
priority: bug
release: 1.9
status: chatting
title: call to get_template() in pypy's doctest can't find template

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list