Skip to content

Commit b05a3e7

Browse files
nissu99tpike3
authored andcommitted
test updated
1 parent 70a3f1f commit b05a3e7

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/test_solara_viz.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,15 @@ def __init__(self, **kwargs):
215215
_check_model_params(ModelWithOnlyRequired.__init__, {})
216216

217217

218-
# Test to check if params are arguments and keyword arguments
219-
def test_check_model_params_with_both_args_and_kwargs():
220-
"""Test that _check_model_params raises ValueError when both *args and **kwargs are present in model initialization."""
221-
222-
class ModelWithArgsAndKwargs:
223-
def __init__(self, param1, *args, **kwargs):
218+
#test that _check_model_params raises ValueError when *args are present
219+
def test_check_model_params_with_args_only():
220+
"""Test that _check_model_params raises ValueError when *args are present."""
221+
222+
class ModelWithArgsOnly:
223+
def __init__(self, param1, *args):
224224
pass
225225

226226
model_params = {"param1": 1}
227227

228-
with pytest.raises(
229-
ValueError, match="Models with both \\*args and \\*\\*kwargs are not supported"
230-
):
231-
_check_model_params(ModelWithArgsAndKwargs.__init__, model_params)
228+
with pytest.raises(ValueError, match= "Mesa's visualization requires the use of keyword arguments to ensure the parameters are passed to Solara correctly. Please ensure all model parameters are of form param=value"):
229+
_check_model_params(ModelWithArgsOnly.__init__, model_params)

0 commit comments

Comments
 (0)