Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 8, 2024
1 parent 38dce53 commit 5f7ccca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_solara_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,18 @@ def __init__(self, **kwargs):
_check_model_params(ModelWithOnlyRequired.__init__, {})


#test that _check_model_params raises ValueError when *args are present
# test that _check_model_params raises ValueError when *args are present
def test_check_model_params_with_args_only():
"""Test that _check_model_params raises ValueError when *args are present."""

class ModelWithArgsOnly:
def __init__(self, param1, *args):
pass

model_params = {"param1": 1}

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"):
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",
):
_check_model_params(ModelWithArgsOnly.__init__, model_params)

0 comments on commit 5f7ccca

Please sign in to comment.