[pypy-issue] Issue #2299: ptest.py --tb native fails with no output when there are application level errors (pypy/pypy)

Devin Jeanpierre issues-reply at bitbucket.org
Thu May 12 19:06:11 EDT 2016


New issue 2299: ptest.py --tb native fails with no output when there are application level errors
https://bitbucket.org/pypy/pypy/issues/2299/ptestpy-tb-native-fails-with-no-output

Devin Jeanpierre:

If I break tests and run `python pytest.py --tb native -s pypy/module/cpyext/`

```
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "_pytest/main.py", line 81, in wrap_session
INTERNALERROR>     doit(config, session)
INTERNALERROR>   File "_pytest/main.py", line 118, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "_pytest/core.py", line 377, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "_pytest/core.py", line 388, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/main.py", line 138, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "_pytest/core.py", line 377, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "_pytest/core.py", line 388, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/runner.py", line 64, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "_pytest/runner.py", line 74, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "_pytest/runner.py", line 110, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "_pytest/main.py", line 162, in call_matching_hooks
INTERNALERROR>     return hookmethod.pcall(plugins, **kwargs)
INTERNALERROR>   File "_pytest/core.py", line 381, in pcall
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "_pytest/core.py", line 388, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/capture.py", line 246, in pytest_runtest_makereport
INTERNALERROR>     rep = __multicall__.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/skipping.py", line 168, in pytest_runtest_makereport
INTERNALERROR>     rep = __multicall__.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/runner.py", line 208, in pytest_runtest_makereport
INTERNALERROR>     longrepr = item.repr_failure(excinfo)
INTERNALERROR>   File "pypy/tool/pytest/apptest.py", line 62, in repr_failure
INTERNALERROR>     return super(AppTestFunction, self).repr_failure(excinfo)
INTERNALERROR>   File "_pytest/python.py", line 581, in repr_failure
INTERNALERROR>     style=self.config.option.tbstyle)
INTERNALERROR>   File "_pytest/python.py", line 576, in _repr_failure_py
INTERNALERROR>     style=style)
INTERNALERROR>   File "_pytest/main.py", line 388, in _repr_failure_py
INTERNALERROR>     style=style)
INTERNALERROR>   File "py/_code/code.py", line 400, in getrepr
INTERNALERROR>     self.type,
INTERNALERROR> AttributeError: 'AppExceptionInfo' object has no attribute 'type'

```

If I fix that by setting self.type to None (dumb fix), it's broken at other levels:

```
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "_pytest/main.py", line 81, in wrap_session
INTERNALERROR>     doit(config, session)
INTERNALERROR>   File "_pytest/main.py", line 118, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "_pytest/core.py", line 377, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "_pytest/core.py", line 388, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/main.py", line 138, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "_pytest/core.py", line 377, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "_pytest/core.py", line 388, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/runner.py", line 64, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "_pytest/runner.py", line 74, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "_pytest/runner.py", line 110, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "_pytest/main.py", line 162, in call_matching_hooks
INTERNALERROR>     return hookmethod.pcall(plugins, **kwargs)
INTERNALERROR>   File "_pytest/core.py", line 381, in pcall
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "_pytest/core.py", line 388, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/capture.py", line 246, in pytest_runtest_makereport
INTERNALERROR>     rep = __multicall__.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/skipping.py", line 168, in pytest_runtest_makereport
INTERNALERROR>     rep = __multicall__.execute()
INTERNALERROR>   File "_pytest/core.py", line 289, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "_pytest/runner.py", line 208, in pytest_runtest_makereport
INTERNALERROR>     longrepr = item.repr_failure(excinfo)
INTERNALERROR>   File "pypy/tool/pytest/apptest.py", line 62, in repr_failure
INTERNALERROR>     return super(AppTestFunction, self).repr_failure(excinfo)
INTERNALERROR>   File "_pytest/python.py", line 581, in repr_failure
INTERNALERROR>     style=self.config.option.tbstyle)
INTERNALERROR>   File "_pytest/python.py", line 576, in _repr_failure_py
INTERNALERROR>     style=style)
INTERNALERROR>   File "_pytest/main.py", line 388, in _repr_failure_py
INTERNALERROR>     style=style)
INTERNALERROR>   File "py/_code/code.py", line 402, in getrepr
INTERNALERROR>     self.traceback[0]._rawentry,
INTERNALERROR> AttributeError: 'AppTracebackEntry' object has no attribute '_rawentry'
```

Basically AFAICT the interface is totally not compatible with what pytest is expecting. Workaround: don't use --tb native?




More information about the pypy-issue mailing list