failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · Textualize/rich
Notes Add support for Exception.__notes__
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||
...................s.F
=================================== FAILURES ===================================
__________________________________ test_notes __________________________________
@pytest.mark.skipif(
sys.version_info.minor < 11, reason="Not supported before Python 3.11"
)
def test_notes() -> None:
"""Check traceback captures __note__."""
try:
> 1 / 0
E ZeroDivisionError: division by zero
E Hello
E World
tests/test_traceback.py:369: ZeroDivisionError
During handling of the above exception, another exception occurred:
@pytest.mark.skipif(
sys.version_info.minor < 11, reason="Not supported before Python 3.11"
)
def test_notes() -> None:
"""Check traceback captures __note__."""
try:
1 / 0
except Exception as error:
error.add_note("Hello")
error.add_note("World")
traceback = Traceback()
> assert traceback.trace.stacks[0].notes == ["Hello", "World"]
E AttributeError: 'Stack' object has no attribute 'notes'
tests/test_traceback.py:375: AttributeError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 20 passed, 1 skipped in 0.63s