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

hide pytest-bdd internal method in user tracebacks #557

Merged
merged 1 commit into from
Aug 28, 2022

Conversation

glehmann
Copy link
Contributor

hide pytest-bdd internal method in user tracebacks.

It makes a much tidier output, a bit like when not using pytest-bdd:

__________________________________________________________________ test_authenticated_access_to_the_application ___________________________________________________________________
.venv/lib/python3.10/site-packages/pytest_bdd/scenario.py:184: in scenario_wrapper
    _execute_scenario(feature, scenario, request)
.venv/lib/python3.10/site-packages/pytest_bdd/scenario.py:154: in _execute_scenario
    _execute_step_function(request, scenario, step, step_func)
.venv/lib/python3.10/site-packages/pytest_bdd/scenario.py:124: in _execute_step_function
    return_value = call_fixture_func(fixturefunc=step_func, request=request, kwargs=kwargs)
.venv/lib/python3.10/site-packages/_pytest/fixtures.py:891: in call_fixture_func
    fixture_result = fixturefunc(**kwargs)
tests/gui/step_defs/star_steps.py:36: in redirected_to_homepage
    assert False
E   AssertionError

becomes just:

__________________________________________________________________ test_authenticated_access_to_the_application ___________________________________________________________________
tests/gui/step_defs/star_steps.py:36: in redirected_to_homepage
    assert False
E   AssertionError

I tried to hide only the methods that I've actually seen in my errors, but a more complete approach may be chosen.

fixes #555

@codecov
Copy link

codecov bot commented Aug 28, 2022

Codecov Report

Merging #557 (64e2086) into master (f686505) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #557   +/-   ##
=======================================
  Coverage   98.49%   98.49%           
=======================================
  Files          32       32           
  Lines         733      733           
  Branches       18       18           
=======================================
  Hits          722      722           
  Misses          9        9           
  Partials        2        2           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@youtux youtux merged commit d7835e5 into pytest-dev:master Aug 28, 2022
pbarnajc pushed a commit to pbarnajc/pytest-bdd that referenced this pull request Jan 31, 2023
hide pytest-bdd internal method in user tracebacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hide pytest-bdd internal methods from tracebacks
2 participants