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 step function resolution logic #544

Closed youtux closed 2 years ago

youtux commented 2 years ago

The step function resolution logic has long been broken. The refactor in #534 made this bug more visible, since it treats all step definitions with and without parsers as the same (previously, definitions without parsers had higher priority).

Also, we now require pytest>=6.2 (I needed to use some newer pytest APIs).

Fixes #542.

codecov[bot] commented 2 years ago

Codecov Report

Merging #544 (a6de47a) into master (96cb467) will increase coverage by 2.71%. The diff coverage is 98.05%.

@@            Coverage Diff             @@
##           master     #544      +/-   ##
==========================================
+ Coverage   92.46%   95.17%   +2.71%     
==========================================
  Files          49       48       -1     
  Lines        1685     1680       -5     
  Branches      208      206       -2     
==========================================
+ Hits         1558     1599      +41     
+ Misses         90       51      -39     
+ Partials       37       30       -7     
Impacted Files Coverage Δ
tests/args/test_common.py 100.00% <ø> (ø)
pytest_bdd/steps.py 95.71% <92.00%> (-0.65%) :arrow_down:
pytest_bdd/generation.py 89.58% <100.00%> (+6.09%) :arrow_up:
pytest_bdd/scenario.py 92.73% <100.00%> (+3.92%) :arrow_up:
tests/conftest.py 100.00% <100.00%> (ø)
tests/feature/test_outline.py 100.00% <100.00%> (ø)
tests/feature/test_scenario.py 100.00% <100.00%> (ø)
tests/feature/test_scenarios.py 100.00% <100.00%> (ø)
tests/feature/test_wrong.py 100.00% <100.00%> (ø)
tests/generation/test_generate_missing.py 100.00% <100.00%> (ø)
... and 13 more

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 96cb467...a6de47a. Read the comment docs.

youtux commented 2 years ago

@The-Compiler would you feel like reviewing the part that uses pytest's internals?