Repository navigation
ExceptionsTest.test_alternating_file_names fails on pypy3 #315
Copy link
Copy link
Open
Description
When running mako's tests with pypy3, I get one failure:
==================================================================== FAILURES =====================================================================
___________________________________________________ ExceptionsTest.test_alternating_file_names ____________________________________________________
Traceback (most recent call last):
File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/test/test_exceptions.py", line 457, in test_alternating_file_names
t.render()
File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/mako/template.py", line 476, in render
return runtime._render(self, self.callable_, args, data)
File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/mako/runtime.py", line 883, in _render
**_kwargs_for_callable(callable_, data)
File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/mako/runtime.py", line 920, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/mako/runtime.py", line 947, in _exec_template
callable_(context, *args, **kwargs)
File "base_html", line 30, in render_body
File "/usr/lib/pypy3.6/lib_pypy/_functools.py", line 80, in __call__
return self._func(*(self._args + fargs), **fkeywords)
File "foo_html", line 54, in render_foo
File "/usr/lib/pypy3.6/lib_pypy/_functools.py", line 80, in __call__
return self._func(*(self._args + fargs), **fkeywords)
File "base_html", line 46, in render_foo
File "base_html", line 17, in broken
RuntimeError: Something went wrong.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/test/test_exceptions.py", line 460, in test_alternating_file_names
assert """
AssertionError: assert '\n File "base.html", line 5, in render_body\n %> body starts here\n File "foo.html", line 4, in render_foo\n ... render_foo\n ${broken()}\n File "base.html", line 4, in broken\n raise RuntimeError("Something went wrong.")\n' in '\n\nTraceback (most recent call last):\n File "/tmp/portage/dev-python/mako-1.1.1/work/Mako-1.1.1/test/test_exceptio..."base.html", line 4, in broken\n raise RuntimeError("Something went wrong.")\nRuntimeError: Something went wrong.\n'
============================================================= short test summary info =============================================================
FAILED test/test_exceptions.py::ExceptionsTest::test_alternating_file_names - AssertionError: assert '\n File "base.html", line 5, in render_bo...
================================================ 1 failed, 415 passed, 53 skipped in 23.80 seconds ================================================
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
mgorny commentedon Feb 21, 2020
FWICS the traceback for PyPy3 is:
while for CPython 3.6 it is:
i.e. PyPy3 intersperses the fancy output twice with:
zzzeek commentedon Feb 21, 2020
this is a very old test but it does need to assert some way of seeing that the stack trace is correct. I can accept PRs that attempt to refine its approach of asserting this.
mgorny commentedon Feb 21, 2020
To be honest, I'm not even sure if it isn't a bug in PyPy3. Are you suggesting accepting this output?
zzzeek commentedon Feb 21, 2020
I'm not sure either but it looks like functools is in pure Python in pypy, which makes sense, im not really sure what the Mako templates are doing involving that, I'd assume its functools.partial() and perhaps in cPython this doesn't put itself into stack traces, not really sure. i don't maintain Mako at this level right now.