Skip to content

Commit

Permalink
test: Add test_theme_unregister
Browse files Browse the repository at this point in the history
The commented out assertion may be added later after resolving #3619
  • Loading branch information
dangotbanned committed Oct 1, 2024
1 parent 4e8def0 commit 9bd0316
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/vegalite/v5/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ def custom_theme() -> ThemeConfig:
assert registered() == {"height": 400, "width": 700} == custom_theme()


def test_theme_unregister() -> None:
@theme.register("big square", enable=True)
def custom_theme() -> ThemeConfig:
return {"height": 1000, "width": 1000}

assert theme.active == "big square"
fn = theme.unregister("big square")
assert fn is not None
assert fn() == custom_theme()
assert theme.active == theme.themes.active
# BUG: https://github.com/vega/altair/issues/3619
# assert theme.active != "big square"


@pytest.mark.parametrize(
("color_code", "valid"),
[
Expand Down

0 comments on commit 9bd0316

Please sign in to comment.