Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: anywidget test (#9038)

Myles Scolnickc945acd87ff9
diff --git a/tests/_plugins/ui/_impl/test_anywidget.py b/tests/_plugins/ui/_impl/test_anywidget.py
index 213884f0e8..f090fe67db 100644
--- a/tests/_plugins/ui/_impl/test_anywidget.py
+++ b/tests/_plugins/ui/_impl/test_anywidget.py
@@ -200,10 +200,10 @@ x = as_marimo_element.count
assert "model_id" in wrapped._initial_value_frontend
assert len(wrapped._initial_value_frontend) == 1
assert isinstance(wrapped._initial_value_frontend["model_id"], str)
- assert wrapped._component_args == {
- "js-url": "",
- "js-hash": md5(b"").hexdigest(),
- }
+ assert wrapped._component_args["js-url"] == ""
+ assert wrapped._component_args["js-hash"] == md5(b"").hexdigest()
+ assert isinstance(wrapped._component_args["model-id"], str)
+ assert len(wrapped._component_args) == 3
@staticmethod
async def test_initialization_with_dataview() -> None:
@@ -215,10 +215,10 @@ x = as_marimo_element.count
assert "model_id" in wrapped._initial_value_frontend
assert len(wrapped._initial_value_frontend) == 1
assert isinstance(wrapped._initial_value_frontend["model_id"], str)
- assert wrapped._component_args == {
- "js-url": "",
- "js-hash": md5(b"").hexdigest(),
- }
+ assert wrapped._component_args["js-url"] == ""
+ assert wrapped._component_args["js-hash"] == md5(b"").hexdigest()
+ assert isinstance(wrapped._component_args["model-id"], str)
+ assert len(wrapped._component_args) == 3
@staticmethod
async def test_custom_methods_and_attributes() -> None: