Skip to content

[question] step arguments in code generation #784

@kurtsys-vintecc

Description

@kurtsys-vintecc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions