pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.32k stars 221 forks source link

Fix combining of scenario outline and pytest parametrization after #445 #455

Closed elchupanebrej closed 2 years ago

elchupanebrej commented 3 years ago

This address to #448

codecov[bot] commented 3 years ago

Codecov Report

Merging #455 (4b34685) into master (6e42167) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #455   +/-   ##
=======================================
  Coverage   95.93%   95.94%           
=======================================
  Files          50       50           
  Lines        1649     1653    +4     
  Branches      153      153           
=======================================
+ Hits         1582     1586    +4     
  Misses         41       41           
  Partials       26       26           
Impacted Files Coverage Δ
tests/feature/test_parametrized.py 100.00% <ø> (ø)
pytest_bdd/parser.py 99.55% <100.00%> (+<0.01%) :arrow_up:
pytest_bdd/scenario.py 91.66% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6e42167...4b34685. Read the comment docs.

elchupanebrej commented 3 years ago

@youtux @olegpidsadnyi Please review

bbatliner commented 2 years ago

This is exactly the patch I was expecting to see after encountering KeyErrors related to the parameterization example in the README with the <start> syntax.

However, Oleg's comment on the related issue suggests that this feature will be removed in the future?

Am I understanding this correctly? Why would this be removed?

elchupanebrej commented 2 years ago

Yes, this feature will be removed. An approach where a test is parametrized inside python code and this parametrization is used in Gherkin scenario definition is broken "by design" because hides some information that has to be present in Examples, so you couldn't share your scenario with stakeholders without losing some information needed for scenario execution. I found that there is some backward incompatibility and created this patch. But with approval from core maintainers, I'll close this patch after removing rudiments of old approach

elchupanebrej commented 2 years ago

Superseded by #469