Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[question] step arguments in code generation

Open
#784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
testing

Research direction

Start with the pytest-bdd generate command and the feature-generation path that handles Scenario Outline steps. Compare the current generated output for with the requested parsed argument and parameterized function, then verify that generated step arguments are usable for the examples shown.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

During code generation pytest-bdd generate ... of a feature, the step arguments are not parsed properly.

Is this the intended behaviour, or should I expect a smarter code generation?

Describe the solution you'd like

It would be nice to have the step arguments parsed properly, e.g.

Feature: comparison

  Scenario Outline: check less than
    Given a value of <value>
    When I have a value of 3
    Then no error should be raised

    Examples:
      | value |
      | 2     |
      | 1     |
      | 0     |

this generates:

...
@given('a value of <value>')
def _():
    """a value of <value>."""
    raise NotImplementedError

I'd expect this to generate something like:

@given(parsers.parse("a value of {value}"))
def given_a_value(value):
    """Given a value of <value>.
    `value` ...
    """
    raise NotImplementedError

Describe alternatives you've considered

Manual, but that's very cumbersome.

Dominant language
Python
Stars
1.5k
Forks
252
Avg merge
2h 8m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pytest-dev/pytest-bdd

All issues in pytest-dev/pytest-bdd

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.