You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/main.py", line 272, in wrap_session
session.exitstatus = doit(config, session) or0^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/main.py", line 326, in _main
config.hook.pytest_runtestloop(session=session)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__returnself._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexecreturnself._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicallraise exception.with_traceback(exception.__traceback__)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/logging.py", line 796, in pytest_runtestloopreturn (yield) # Run all the tests.^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/main.py", line 351, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__returnself._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexecreturnself._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicallraise exception.with_traceback(exception.__traceback__)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/warnings.py", line 109, in pytest_runtest_protocolreturn (yield)
^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/assertion/__init__.py", line 174, in pytest_runtest_protocolreturn (yield)
^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/unittest.py", line 408, in pytest_runtest_protocol
res =yield^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/faulthandler.py", line 85, in pytest_runtest_protocolreturn (yield)
^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/runner.py", line 114, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/runner.py", line 133, in runtestprotocol
reports.append(call_and_report(item, "call", log))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/runner.py", line 228, in call_and_report
report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__returnself._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexecreturnself._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicallraise exception.with_traceback(exception.__traceback__)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/tmpdir.py", line 316, in pytest_runtest_makereport
rep =yield^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
teardown.throw(exception) # type:ignore[union-attr]^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/skipping.py", line 269, in pytest_runtest_makereport
rep =yield^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/runner.py", line 372, in pytest_runtest_makereportreturn TestReport.from_item_and_call(item, call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/reports.py", line 364, in from_item_and_call
longrepr = item.repr_failure(excinfo)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/python.py", line 1877, in repr_failurereturnself._repr_failure_py(excinfo, style=style)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/nodes.py", line 497, in _repr_failure_pyreturn excinfo.getrepr(
^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 698, in getreprreturn fmt.repr_excinfo(self)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 1057, in repr_excinfo
reprtraceback =self.repr_traceback(excinfo_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 981, in repr_traceback
entries = [
^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 982, in <listcomp>self.repr_traceback_entry(entry, excinfo if last == entry elseNone)
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 920, in repr_traceback_entry
source =self._getentrysource(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 822, in _getentrysource
source = entry.getsource(self.astcache)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/code.py", line 259, in getsource
astnode, _, end = getstatementrange_ast(
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/_pytest/_code/source.py", line 199, in getstatementrange_ast
block_finder.started = source.lines[start][0].isspace()
~~~~~~~~~~~~~~~~~~~^^^IndexError: string index out of range
This was because incomplete_input (python/cpython@cd6e0a0) was causing an error in my module. Still, pytest was of no help until I monkey patched it to check if the string actually contains something.
Activity
The-Compiler commentedon Feb 8, 2024
Relevant part of the logs:
solaluset commentedon Feb 9, 2024
This was because
incomplete_input(python/cpython@cd6e0a0) was causing an error in my module. Still, pytest was of no help until I monkey patched it to check if the string actually contains something.code: fix `IndexError` crash in `getstatementrange_ast`
bluetech commentedon Feb 17, 2024
I submitted a fix in #11996, maybe you can verify that it fixes the issue.
solaluset commentedon Feb 17, 2024
@bluetech I confirm that it works
code: fix `IndexError` crash in `getstatementrange_ast`
code: fix `IndexError` crash in `getstatementrange_ast`