Skip to content

Commit 4aac6eb

Browse files
authored
Merge pull request #5519 from TomJGooding/test-add-missing-assertions-to-snapshot-tests
test: add missing assertions to snapshot tests
2 parents 80ea233 + d4be018 commit 4aac6eb

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

tests/snapshot_tests/test_snapshots.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,7 @@ def render(self) -> LinearGradient:
24182418
return LinearGradient(30.0, stops)
24192419

24202420
app = TransparentApp()
2421-
snap_compare(app)
2421+
assert snap_compare(app)
24222422

24232423

24242424
def test_maximize_allow(snap_compare):
@@ -2888,7 +2888,7 @@ async def run_before(pilot: Pilot) -> None:
28882888
await pilot.pause()
28892889
await pilot.click("Select")
28902890

2891-
snap_compare(TallSelectApp(), run_before=run_before)
2891+
assert snap_compare(TallSelectApp(), run_before=run_before)
28922892

28932893

28942894
def test_markup_command_list(snap_compare):
@@ -2908,7 +2908,7 @@ def on_mount(self) -> None:
29082908
]
29092909
)
29102910

2911-
snap_compare(MyApp())
2911+
assert snap_compare(MyApp())
29122912

29132913

29142914
def test_app_resize_order(snap_compare):
@@ -2950,7 +2950,7 @@ def on_mount(self) -> None:
29502950
def on_resize(self) -> None:
29512951
self.add_class("narrow")
29522952

2953-
snap_compare(SCApp())
2953+
assert snap_compare(SCApp())
29542954

29552955

29562956
def test_add_remove_tabs(snap_compare):
@@ -2981,7 +2981,7 @@ def action_add_pane(self) -> None:
29812981
new_pane = TabPane("New tab", Label("new"))
29822982
tabbed_content.add_pane(new_pane)
29832983

2984-
snap_compare(ExampleApp(), press=["a", "r", "a"])
2984+
assert snap_compare(ExampleApp(), press=["a", "r", "a"])
29852985

29862986

29872987
def test_click_expand(snap_compare):
@@ -2998,7 +2998,7 @@ async def run_before(pilot: Pilot) -> None:
29982998
await pilot.pause()
29992999
await pilot.click(Select)
30003000

3001-
snap_compare(SelectApp(), run_before=run_before)
3001+
assert snap_compare(SelectApp(), run_before=run_before)
30023002

30033003

30043004
def test_disable_command_palette(snap_compare):
@@ -3019,7 +3019,7 @@ def check_action(
30193019
return None
30203020
return True
30213021

3022-
snap_compare(FooterApp())
3022+
assert snap_compare(FooterApp())
30233023

30243024

30253025
def test_selection_list_wrap(snap_compare):
@@ -3029,7 +3029,7 @@ class SelectionListApp(App):
30293029
def compose(self) -> ComposeResult:
30303030
yield SelectionList(("Hello World " * 100, 0))
30313031

3032-
snap_compare(SelectionListApp())
3032+
assert snap_compare(SelectionListApp())
30333033

30343034

30353035
def test_border_tab(snap_compare):
@@ -3054,7 +3054,7 @@ def compose(self) -> ComposeResult:
30543054
label.border_subtitle = ":-)"
30553055
yield label
30563056

3057-
snap_compare(TabApp())
3057+
assert snap_compare(TabApp())
30583058

30593059

30603060
def test_dock_align(snap_compare):
@@ -3126,7 +3126,7 @@ class Test1(App):
31263126
def compose(self):
31273127
yield MainContainer()
31283128

3129-
snap_compare(Test1())
3129+
assert snap_compare(Test1())
31303130

31313131

31323132
def test_auto_parent_with_alignment(snap_compare):
@@ -3163,7 +3163,7 @@ class FloatSidebarApp(App):
31633163
def compose(self) -> ComposeResult:
31643164
yield Sidebar()
31653165

3166-
snap_compare(FloatSidebarApp())
3166+
assert snap_compare(FloatSidebarApp())
31673167

31683168

31693169
def test_select_refocus(snap_compare):
@@ -3207,7 +3207,7 @@ def compose(self):
32073207
with Container():
32083208
yield MyListView()
32093209

3210-
snap_compare(TUI(), press=["down", "enter", "down", "down", "enter"])
3210+
assert snap_compare(TUI(), press=["down", "enter", "down", "down", "enter"])
32113211

32123212

32133213
def test_widgets_in_grid(snap_compare):
@@ -3243,7 +3243,7 @@ def compose(self) -> ComposeResult:
32433243
label.border_title = str(n)
32443244
yield label
32453245

3246-
snap_compare(MyApp(), terminal_size=(100, 50))
3246+
assert snap_compare(MyApp(), terminal_size=(100, 50))
32473247

32483248

32493249
def test_arbitrary_selection(snap_compare):
@@ -3296,7 +3296,7 @@ def on_mount(self) -> None:
32963296
for number in range(1, 100):
32973297
t1.add_row(str(number) + " " * 200)
32983298

3299-
snap_compare(MyApp())
3299+
assert snap_compare(MyApp())
33003300

33013301

33023302
def test_scrollbar_background_with_opacity(snap_compare):
@@ -3342,7 +3342,7 @@ def compose(self) -> ComposeResult:
33423342
yield Label("This allows [bold]markup[/bold]")
33433343
yield Label("This does not allow [bold]markup[/bold]", markup=False)
33443344

3345-
snap_compare(LabelApp())
3345+
assert snap_compare(LabelApp())
33463346

33473347

33483348
def test_arbitrary_selection_double_cell(snap_compare):
@@ -3447,7 +3447,7 @@ class OptionListAutoCrash(App[None]):
34473447
def compose(self) -> ComposeResult:
34483448
yield OptionList()
34493449

3450-
snap_compare(OptionListAutoCrash())
3450+
assert snap_compare(OptionListAutoCrash())
34513451

34523452

34533453
def test_focus_within_transparent(snap_compare):
@@ -3491,7 +3491,7 @@ def compose(self) -> ComposeResult:
34913491
yield OptionList(*["This is an option" for _ in range(30)])
34923492
yield Input(placeholder="Escape out via here for the bug")
34933493

3494-
snap_compare(FocusWithinTransparentApp(), press=["tab"])
3494+
assert snap_compare(FocusWithinTransparentApp(), press=["tab"])
34953495

34963496

34973497
def test_option_list_wrapping(snap_compare):
@@ -3511,7 +3511,7 @@ def compose(self) -> ComposeResult:
35113511
"This is a very long option that is too wide to fit within the space provided and will overflow."
35123512
)
35133513

3514-
snap_compare(OLApp())
3514+
assert snap_compare(OLApp())
35153515

35163516

35173517
def test_add_separator(snap_compare):
@@ -3549,7 +3549,7 @@ async def run_before(pilot: Pilot) -> None:
35493549
await pilot.click(Button)
35503550
await pilot.pause(0.4)
35513551

3552-
snap_compare(FocusTest(), run_before=run_before)
3552+
assert snap_compare(FocusTest(), run_before=run_before)
35533553

35543554

35553555
def test_visual_tooltip(snap_compare):
@@ -3576,4 +3576,4 @@ async def run_before(pilot: Pilot) -> None:
35763576
await pilot.pause(0.4)
35773577
await pilot.pause()
35783578

3579-
snap_compare(TooltipApp(), run_before=run_before)
3579+
assert snap_compare(TooltipApp(), run_before=run_before)

0 commit comments

Comments
 (0)