Arfrever Frehtes Taifersar Arahesis added the comment:

Commit 33fb5600e9a1 causes 1 test failure in test suite of py 
(https://pypi.python.org/pypi/py).
Test suite of py requires pytest (https://pypi.python.org/pypi/pytest)
The failing test (test_excinfo_no_python_sourcecode) requires Jinja 
(https://pypi.python.org/pypi/Jinja2) and is skipped otherwise.
This test also passes with Python 3.*.

Output with py 1.4.23, pytest 2.6.0 and Jinja 2.7.3:

$ python2.7 -m pytest testing/code/test_excinfo.py
==================================================================== test 
session starts 
====================================================================
platform linux2 -- Python 2.7.9 -- py-1.4.23 -- pytest-2.6.0
collected 71 items 

testing/code/test_excinfo.py 
....................F..................................................

========================================================================= 
FAILURES 
==========================================================================
_____________________________________________________________ 
test_excinfo_no_python_sourcecode 
_____________________________________________________________

tmpdir = local('/tmp/pytest-0/test_excinfo_no_python_sourcec0')

    def test_excinfo_no_python_sourcecode(tmpdir):
        #XXX: simplified locally testable version
        tmpdir.join('test.txt').write("{{ h()}}:")
    
        jinja2 = py.test.importorskip('jinja2')
        loader = jinja2.FileSystemLoader(str(tmpdir))
        env = jinja2.Environment(loader=loader)
>       template = env.get_template('test.txt')

testing/code/test_excinfo.py:290: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python2.7/site-packages/jinja2/environment.py:791: in get_template
    return self._load_template(name, self.make_globals(globals))
/usr/lib64/python2.7/site-packages/jinja2/environment.py:765: in _load_template
    template = self.loader.load(self, name, globals)
/usr/lib64/python2.7/site-packages/jinja2/loaders.py:135: in load
    globals, uptodate)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'jinja2.environment.Template'>, environment = 
<jinja2.environment.Environment object at 0x7f0ed6f26f10>
code = <code object <module> at 0x7f0ed6f2d930, file 
"/tmp/pytest-0/test_excinfo_no_python_sourcec0/test.txt", line 1>
globals = {'cycler': <class 'jinja2.utils.Cycler'>, 'dict': <function <lambda> 
at 0x7f0ed73c97d0>, 'joiner': <class 'jinja2.utils.Joiner'>, 'lipsum': 
<function generate_lorem_ipsum at 0x7f0ed7835398>, ...}
uptodate = <function uptodate at 0x7f0ed6f22ed8>

    @classmethod
    def from_code(cls, environment, code, globals, uptodate=None):
        """Creates a template object from compiled code and the globals.  This
            is used by the loaders and environment to create a template object.
            """
        namespace = {
            'environment':  environment,
            '__file__':     code.co_filename
        }
>       exec(code, namespace)
E       TypeError: exec: arg 1 must be a string, file, or code object

/usr/lib64/python2.7/site-packages/jinja2/environment.py:917: TypeError
================================================================== short test 
summary info ==================================================================
FAIL testing/code/test_excinfo.py::test_excinfo_no_python_sourcecode
============================================================ 1 failed, 70 
passed in 1.66 seconds 
============================================================

----------
assignee:  -> djc
nosy: +Arfrever
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21591>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to