test fixes

This commit is contained in:
Will McGugan
2024-11-15 16:42:06 +00:00
parent 326e6c4fe3
commit a0d458789d
5 changed files with 6 additions and 12 deletions

View File

@@ -462,9 +462,6 @@ class App(Generic[ReturnType], DOMNode):
SUSPENDED_SCREEN_CLASS: ClassVar[str] = ""
"""Class to apply to suspended screens, or empty string for no class."""
HOVER_EFFECTS_SCROLL_PAUSE: ClassVar[float] = 0.02
"""Seconds to pause hover effects for when scrolling."""
_PSEUDO_CLASSES: ClassVar[dict[str, Callable[[App[Any]], bool]]] = {
"focus": lambda app: app.app_focus,
"blur": lambda app: not app.app_focus,
@@ -2824,8 +2821,6 @@ class App(Generic[ReturnType], DOMNode):
Args:
widget: Widget under mouse, or None for no widgets.
"""
if widget is not None and widget.is_scrolling:
return
if widget is None:
if self.mouse_over is not None:
try:

View File

@@ -72,10 +72,10 @@ async def test_lists_of_selectors_in_nested_css() -> None:
class DeclarationAfterNestedApp(App[None]):
CSS = """
Screen {
background: green;
Label {
background: red;
}
background: green;
}
"""

View File

@@ -4,7 +4,6 @@ from textual.widgets import Checkbox, Footer
class ScrollOffByOne(App):
AUTO_FOCUS = None
HOVER_EFFECTS_SCROLL_PAUSE = 0.0
def compose(self) -> ComposeResult:
for number in range(1, 100):

View File

@@ -6,7 +6,6 @@ class ScrollOffByOne(App):
"""Scroll to item 50."""
AUTO_FOCUS = None
HOVER_EFFECTS_SCROLL_PAUSE = 0
def compose(self) -> ComposeResult:
for number in range(1, 100):

View File

@@ -39,10 +39,11 @@ async def test_lazy_reveal():
async with app.run_test() as pilot:
# No #foo on initial mount
# Only first child should be visible initially
# Only first child should be available initially
assert app.query_one("#foo").display
assert not app.query_one("#bar").display
assert not app.query_one("#baz").display
# Next two aren't mounted yet
assert not app.query("#bar")
assert not app.query("#baz")
# All children should be visible after a pause
await pilot.pause()