pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.31k stars 221 forks source link

pytest_bdd_after_scenario has scenario status PASSED even if it failed #585

Open dmitriykow7 opened 1 year ago

dmitriykow7 commented 1 year ago

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 image

[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

david-m-globant commented 3 months ago

I have the same problem