Skip to content

Commit 8d45e08

Browse files
committed
mypy
1 parent 3d121c4 commit 8d45e08

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/devtools/test_devtools.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from rich.align import Align
77
from rich.console import Console
88
from rich.segment import Segment
9+
from rich.table import Table
10+
from rich.text import Text
911

1012
from textual_dev.renderables import DevConsoleLog, DevConsoleNotice
1113

@@ -43,19 +45,24 @@ def test_log_message_render(console) -> None:
4345
severity=0,
4446
)
4547
table = next(iter(message.__rich_console__(console, console.options)))
48+
assert isinstance(table, Table)
4649

4750
assert len(table.rows) == 1
4851

4952
columns = list(table.columns)
5053
left_cells = list(columns[0].cells)
5154
left = left_cells[0]
5255
right_cells = list(columns[1].cells)
56+
assert isinstance(right_cells[0], Align)
5357
right: Align = right_cells[0]
5458

5559
# Since we can't guarantee the timezone the tests will run in...
5660
local_time = datetime.fromtimestamp(TIMESTAMP)
5761
string_timestamp = local_time.time()
5862

63+
assert isinstance(left, Text)
64+
assert isinstance(right.renderable, Text)
65+
5966
assert left.plain == f"[{string_timestamp}] UNDEFINED"
6067
assert right.align == "right"
6168
assert "hello.py:123" in right.renderable
@@ -64,6 +71,7 @@ def test_log_message_render(console) -> None:
6471
def test_internal_message_render(console):
6572
message = DevConsoleNotice("hello")
6673
rule = next(iter(message.__rich_console__(console, console.options)))
74+
assert isinstance(rule, Rule)
6775
assert rule.title == "hello"
6876
assert rule.characters == "─"
6977

0 commit comments

Comments
 (0)