Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing utf-8 decoding in tests #6641

Merged
merged 7 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions panel/pane/_textual.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@

class PanelDriver(Driver):

def __init__(
self,
app: App,
*,
debug: bool = False,
size: tuple[int, int] | None = None
) -> None:
super().__init__(app, debug=debug, size=size)
def __init__(self, app: App, /, **kwargs) -> None:
super().__init__(app, **kwargs)
self._terminal = app.__panel__._terminal
self._input_initialized = False
self._input_watcher = None
Expand Down
2 changes: 1 addition & 1 deletion panel/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def is_panel_pane(attr):
def find_indexed(index):
indexed = []
toctree = False
for line in index.read_text().split('\n'):
for line in index.read_text(encoding="utf-8").split('\n'):
if line == '```{toctree}':
toctree = True
elif not toctree:
Expand Down
4 changes: 2 additions & 2 deletions panel/tests/ui/layout/test_accordion.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def accordion_components():


def is_collapsed(card_object, card_content):
expect(card_object).to_contain_text("\u25ba")
expect(card_object.locator('svg')).to_have_class("icon icon-tabler icons-tabler-outline icon-tabler-chevron-right")
expect(card_object).not_to_contain_text(card_content)
return True


def is_expanded(card_object, card_content):
expect(card_object).to_contain_text("\u25bc")
expect(card_object.locator('svg')).to_have_class("icon icon-tabler icons-tabler-outline icon-tabler-chevron-down")
expect(card_object).to_contain_text(card_content)
return True

Expand Down
7 changes: 3 additions & 4 deletions panel/tests/ui/layout/test_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def test_card_default(page, card_components):

# icon display in card button in expanded mode
card_button = page.locator('.card-button')
button_name = card_button.inner_text()
assert button_name == "\u25bc"
expect(card_button.locator('svg')).to_have_class("icon icon-tabler icons-tabler-outline icon-tabler-chevron-down")


def test_card_collapsed(page, card_components):
Expand All @@ -52,15 +51,15 @@ def test_card_collapsed(page, card_components):
# collapse the card
card_button.wait_for()
card_button.click()
assert card_button.inner_text() == "\u25ba"
expect(card_button.locator('svg')).to_have_class("icon icon-tabler icons-tabler-outline icon-tabler-chevron-right")
# only show the card header, other elements are hidden
expect(card_elements).to_have_count(1)

# expand the card again
card_button.wait_for()
card_button.click()
expect(card_elements).to_have_count(len(card) + 1)
assert card_button.inner_text() == "\u25bc"
expect(card_button.locator('svg')).to_have_class("icon icon-tabler icons-tabler-outline icon-tabler-chevron-down")


def test_card_not_collapsible(page, card_components):
Expand Down
Loading