Package: src:python-memray
Version: 1.17.0+dfsg-1
Tags: patch
Fix compatibility with Textual 8 by falling back from renderable to content.
Description: Fix compatibility with Textual 8.
Textual 8 renamed the Widget.renderable attribute to Widget.content.
The render_widget helper in the test suite used renderable, causing
test failures with Textual 8. This patch adds a fallback: first
tries renderable (for backward compat), then falls back to content.
.
The helper is only used in tests.
Forwarded: https://bugs.debian.org/1135455
Author: Claudio <[email protected]>
Last-Update: 2025-04-11
--- a/tests/unit/test_tui_reporter.py
+++ b/tests/unit/test_tui_reporter.py
@@ -90,7 +90,11 @@ def compare_impl(
def render_widget(widget: Widget) -> str:
output = StringIO()
- rprint(widget.renderable, file=output) # type: ignore
+ content = getattr(widget, "renderable", None)
+ if content is None:
+ content = widget.content
+ assert content is not None
+ rprint(content, file=output)
return output.getvalue()