pytest-dev / pytest-dev/pytest-bdd
pytest_bdd_after_scenario has scenario status PASSED even if it failed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 251
- Avg merge
- 43m
- Merged PRs (30d)
- 2
Description
Fixtrue pytest_bdd_after_scenario(scenario: Scenario):
All steps and scenarios has status failed=False, however test failed
and pytest_bdd_step_error fixture worked correct

[gw0] [ 25%] FAILED ui_steps/test_reports_steps.py::test_deselect_facility_daily_risk_report[chromium] <- venv/lib/python3.9/site-packages/pytest_bdd/scenario.py ##teamcity[testFailed timestamp='2022-11-21T12:32:51.881' details='cls = <class |'_pytest.runner.CallInfo|'>|nfunc = <function call_runtest_hook.. at 0x107211c10>|nwhen = |'call|'|nreraise = (<class |'_pytest.outcomes.Exit|'>, <class |'KeyboardInterrupt|'>)|n|n @classmethod|n def from_call(|n cls,|n func: "Callable|[|[|], TResult|]",|n when: "Literal|[|'collect|', |'setup|', |'call|', |'teardown|'|]",|n reraise: Optional|[|n Union|[Type|[BaseException|], Tuple|[Type|[BaseException|], ...|]|]|n |] = None,|n ) -> "CallInfo|[TResult|]":|n """Call func, wrapping the result in a CallInfo.|n |n :param func:|n The function to call. Called without arguments.|n :param when:|n The phase in which the function is called.|n :param reraise:|n Exception or exceptions that shall propagate if raised by the|n function, instead of being wrapped in the CallInfo.|n """|n excinfo = None|n start = timing.time()|n precise_start = timing.perf_counter()|n try:|n> result: Optional|[TResult|] = fu
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pytest_bdd_after_scenario and pytest_bdd_step_error fixtures, then inspect the pytest-bdd scenario.py path shown in the failure report. Reproduce the failing scenario and verify that the after-scenario fixture reports a failed status when the test fails, while the step-error fixture remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100