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
{{ message }}
Repository navigation
SyntaxError: no symbol table available in pytest_runtest_protocol (type: Function) #6697
@fanninpm It's just a function definition, so the behaviour for CPython is that it does nothing because no nontrivial code runs.
(If you called the function it would also do nothing except return None, but the error doesn't require running the function, only loading a file with it in it)
Rechecked on current main with a RustPython venv (pip install pytest). pytest 9.1.1 imports, including _pytest.pytester (the originally failing pytest_runtest_protocol body with a generator expression in finally). from pytest import console_main works, and a two-test run reports 2 passed. Closing per #8982.
Activity
DRMacIver commentedon Mar 27, 2026
Here's a simpler reproducer for this problem BTW:
Seems to be a problem with any comprehension expression inside a finally block.
fanninpm commentedon May 24, 2026
@DRMacIver What is the behavior of CPython with that reproducer, so we have a baseline?
DRMacIver commentedon May 24, 2026
@fanninpm It's just a function definition, so the behaviour for CPython is that it does nothing because no nontrivial code runs.
(If you called the function it would also do nothing except return None, but the error doesn't require running the function, only loading a file with it in it)
YangSiJun528 commentedon Jul 11, 2026
take
YangSiJun528 commentedon Sep 3, 2026
This was fixed by #8507.
@youknowone, could you please close this issue?
fanninpm commentedon Sep 3, 2026
@anki-code @DRMacIver has this been fixed on the latest
maincommit?Add independently verified pytest issue to closure report
Preserve literal Python blocks when relocating report links
youknowone commentedon Oct 6, 2026
Rechecked on current main with a RustPython venv (
pip install pytest). pytest 9.1.1 imports, including_pytest.pytester(the originally failingpytest_runtest_protocolbody with a generator expression infinally).from pytest import console_mainworks, and a two-test run reports2 passed. Closing per #8982.— commented by Grok 4.6