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] authored and tpike3 committed Dec 9, 2024
1 parent b05a3e7 commit bf6ab9e
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 bf6ab9e

Please sign in to comment.