Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed May 12, 2024
1 parent 9e094e6 commit 10887ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/textual/dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ def walk_children(
return cast("list[DOMNode]", nodes)

@overload
def query(self, selector: str | None) -> DOMQuery[Widget]: ...
def query(self, selector: str | None = None) -> DOMQuery[Widget]: ...

@overload
def query(self, selector: type[QueryType]) -> DOMQuery[QueryType]: ...
Expand All @@ -1259,7 +1259,7 @@ def query(
return DOMQuery[QueryType](self, filter=selector.__name__)

@overload
def query_children(self, selector: str | None) -> DOMQuery[Widget]: ...
def query_children(self, selector: str | None = None) -> DOMQuery[Widget]: ...

@overload
def query_children(self, selector: type[QueryType]) -> DOMQuery[QueryType]: ...
Expand Down
1 change: 1 addition & 0 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class App(Widget):

# repeat tests to account for caching
for repeat in range(3):
assert list(app.query_children()) == [main_view, help_view]
assert list(app.query_children("*")) == [main_view, help_view]
assert list(app.query_children("#help")) == [help_view]
assert list(main_view.query_children(".float")) == [sidebar]
Expand Down

0 comments on commit 10887ee

Please sign in to comment.