Skip to content

Commit

Permalink
Test an unexpected argument
Browse files Browse the repository at this point in the history
  • Loading branch information
inno committed May 12, 2024
1 parent f6adb2f commit 7be37b8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_params_to_kwargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ def test_required():
pos_args=[],
kw_args={"testparam1": "fooo"},
)


def test_unknown_arg():
p1 = Param(name="testparam1", annotation=str, required=False)
with pytest.raises(SystemExit, match="foo") as e:
params_to_kwargs(
params=[p1],
pos_args=[],
kw_args={"foo": "bar"},
)
assert "Unexpected argument" in str(e.value.args)

0 comments on commit 7be37b8

Please sign in to comment.