File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,33 @@ def _():
286286 ]
287287
288288
289+ def test_step_parser_argument_not_in_function_signature_does_not_fail (pytester ):
290+ """Test that if the step parser defines an argument, but step function does not accept it,
291+ then it does not fail and the params is just not filled."""
292+
293+ pytester .makefile (
294+ ".feature" ,
295+ simple = """
296+ Feature: Simple feature
297+ Scenario: Step with missing argument
298+ Given a user with username "user1"
299+ """ ,
300+ )
301+ pytester .makepyfile (
302+ """
303+ from pytest_bdd import scenarios, given, parsers
304+
305+ scenarios("simple.feature")
306+
307+ @given(parsers.parse('a user with username "{username}"'))
308+ def create_user():
309+ pass
310+ """
311+ )
312+ result = pytester .runpytest ()
313+ result .assert_outcomes (passed = 1 )
314+
315+
289316def test_multilanguage_support (pytester ):
290317 """Test multilanguage support."""
291318 pytester .makefile (
You can’t perform that action at this time.
0 commit comments