From 216d05b17f43a7140533c51a8f8177a8780882ac Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 20 Sep 2022 16:33:07 +0100 Subject: [PATCH] test fix --- tests/test_animator.py | 4 ++-- tests/test_integration_layout.py | 7 +------ tests/test_widget.py | 2 ++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/test_animator.py b/tests/test_animator.py index 159600d7a..a92f38c96 100644 --- a/tests/test_animator.py +++ b/tests/test_animator.py @@ -60,7 +60,7 @@ def test_simple_animation(): assert animate_test.foo == 40.0 assert animation(time + 2.9) is False # Not quite final value - assert pytest.approx(animate_test.foo, 49.0) + assert animate_test.foo == pytest.approx(49.0) assert animation(time + 3.0) is True # True to indicate animation is complete assert animate_test.foo is None # This is final_value @@ -161,7 +161,7 @@ def test_animatable(): assert animate_test.bar.value == 40.0 assert animation(time + 2.9) is False - assert pytest.approx(animate_test.bar.value, 49.0) + assert animate_test.bar.value == pytest.approx(49.0) assert animation(time + 3.0) is True # True to indicate animation is complete assert animate_test.bar.value == 50.0 diff --git a/tests/test_integration_layout.py b/tests/test_integration_layout.py index c95847ab0..cbfaaced9 100644 --- a/tests/test_integration_layout.py +++ b/tests/test_integration_layout.py @@ -271,12 +271,6 @@ async def test_border_edge_types_impact_on_widget_size( ("overflow: auto", "scrollbar-size-horizontal: 3"), Size(20 - SCROLL_V_SIZE, 20 - 3), ], - # scrollbar needed only vertically, custom scrollbar size - [ - Size(20, 30), - ("overflow: auto", "scrollbar-size: 3 3"), - Size(20 - 3, 20), - ], # scrollbar needed only horizontally, custom scrollbar size [ Size(30, 20), @@ -314,6 +308,7 @@ async def test_scrollbar_size_impact_on_the_layout( ) large_widget = LargeWidget() + large_widget.expand = False container = LargeWidgetContainer(large_widget, id="large-widget-container") class MyTestApp(AppTest): diff --git a/tests/test_widget.py b/tests/test_widget.py index 5ccedd39d..c2866e5f6 100644 --- a/tests/test_widget.py +++ b/tests/test_widget.py @@ -37,7 +37,9 @@ def test_widget_content_width(): class TextWidget(Widget): def __init__(self, text: str, id: str) -> None: self.text = text + super().__init__(id=id) + self.expand = False def render(self) -> str: return self.text