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

Allow "yield" in step definitions #503

Closed youtux closed 2 years ago

youtux commented 2 years ago

This way step definitions can define code to be executed during teardown of the test item. Apparently this behaviour was broken by the 4.0 release.

Fixes #392.

codecov[bot] commented 2 years ago

Codecov Report

Merging #503 (512fd0f) into master (385e6c9) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #503      +/-   ##
==========================================
+ Coverage   95.48%   95.49%   +0.01%     
==========================================
  Files          48       48              
  Lines        1571     1577       +6     
  Branches      170      170              
==========================================
+ Hits         1500     1506       +6     
  Misses         44       44              
  Partials       27       27              
Impacted Files Coverage Δ
pytest_bdd/cucumber_json.py 93.33% <100.00%> (ø)
pytest_bdd/scenario.py 91.07% <100.00%> (ø)
tests/feature/test_steps.py 100.00% <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 385e6c9...512fd0f. Read the comment docs.