Files
textual/tests/test_textlog.py
TomJGooding 7a9d32fdbf test: make tests async to fix failures on Python 3.9
After upgrading `pytest-asyncio` to the latest version, lots of tests
started failing in CI only on Python 3.9:

`RuntimeError: There is no current event loop in thread 'MainThread'`

Apparently these tests may have only been passing previously due to
issues in earlier versions of `pytest-asyncio`. Changing these tests to
async seems to fix the failures on Python 3.9.

Related issue:
https://github.com/pytest-dev/pytest-asyncio/issues/1039
2025-09-17 13:38:05 +01:00

12 lines
350 B
Python

from rich.text import Text
from textual.widgets import RichLog
async def test_make_renderable_expand_tabs():
# Regression test for https://github.com/Textualize/textual/issues/3007
text_log = RichLog()
renderable = text_log._make_renderable("\tfoo")
assert isinstance(renderable, Text)
assert renderable.plain == " foo"