Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusable step functions #534

Merged
merged 27 commits into from
Jul 15, 2022
Merged

Reusable step functions #534

merged 27 commits into from
Jul 15, 2022

Conversation

youtux
Copy link
Contributor

@youtux youtux commented Jul 10, 2022

This PR fixes some bugs happening when a step function is decorated multiple times with @given (or when, then):

  • steps without parsers would take precedence over steps with parsers
  • step functions can now be decorated multiple times with @given, @when, @then. Previously every decorator would override converters and target_fixture every at every application.

Fixes #525

@codecov
Copy link

codecov bot commented Jul 10, 2022

Codecov Report

Merging #534 (fa9192d) into master (31dab36) will decrease coverage by 0.21%.
The diff coverage is 98.94%.

@@            Coverage Diff             @@
##           master     #534      +/-   ##
==========================================
- Coverage   92.65%   92.43%   -0.22%     
==========================================
  Files          48       49       +1     
  Lines        1660     1679      +19     
  Branches      207      208       +1     
==========================================
+ Hits         1538     1552      +14     
- Misses         84       90       +6     
+ Partials       38       37       -1     
Impacted Files Coverage Δ
pytest_bdd/steps.py 96.36% <94.73%> (-1.56%) ⬇️
pytest_bdd/generation.py 83.48% <100.00%> (ø)
pytest_bdd/scenario.py 88.81% <100.00%> (-0.60%) ⬇️
tests/args/test_common.py 100.00% <100.00%> (ø)
tests/library/test_parent.py 100.00% <100.00%> (ø)
tests/steps/test_common.py 100.00% <100.00%> (ø)
pytest_bdd/utils.py 76.31% <0.00%> (-13.16%) ⬇️

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 31dab36...fa9192d. Read the comment docs.

@youtux youtux added the feature label Jul 10, 2022
@youtux youtux marked this pull request as ready for review July 10, 2022 15:49
@The-Compiler
Copy link
Member

I believe this introduced a regression when a specific step definition shadows one with a parser - see #542.

pbarnajc pushed a commit to pbarnajc/pytest-bdd that referenced this pull request Jan 31, 2023
pbarnajc pushed a commit to pbarnajc/pytest-bdd that referenced this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow (or test that) step functions can have the same name
2 participants