Traceback handling fails on apache_beam code #10602
Labels
topic: tracebacks
related to displaying and handling of tracebacks
type: bug
problem that needs to be addressed
Hello,
When running tests that use
apache_beam
I must use--tb=native
otherwisepytest
fails when trying to pretty-print the traceback of the failure.Minimal example: https://github.com/bfontaine/pytest-beam-bug
The
pyproject.toml
was generated withpoetry init -n; poetry add pytest apache_beam
.test_a.py
contains a small failing test that usesapache_beam
.To reproduce, clone the repository, then run
poetry install
andpoetry run pytest
.Expected: a test failure
Actual:
INTERNALERROR> "…/_pytest/_code/code.py", line 751, in get_source: IndexError: list index out of range
Full output
output of
pip list
If I edit Pytest’s code to add
print(source.lines, line_index)
just above the line that fails, I get an output that ends with:This explains why there is an
IndexError
. I’m not sure howline_index
can be-1878
though.The text was updated successfully, but these errors were encountered: