[question] step arguments in code generation
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytest-dev/pytest-bdd
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pytest-dev/pytest-bdd#838 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
pytest-dev/pytest-bdd#805 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
pytest-dev/pytest-bdd#785 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
pytest-dev/pytest-bdd#782 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
pytest-dev/pytest-bdd#780 · 5 reactions ·
All issues in pytest-dev/pytest-bdd
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
topoteretes/cognee#5647 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Sendspin/sendspin-python-cli#291 ·
Maintainers usually reply within 6 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
awslabs/visual-asset-management-system#414 ·
Maintainers usually reply within 1 day
-
bug v1 v2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/python-sdk#3670 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aicell-lab/bioengine#232 ·
Maintainers usually reply within 1 day