after_scenario_hookΒΆ

.. py:function:: after_scenario_hook(context: ~typing.Any, scenario: ~typing.Any) -> None :module: behave_retry

Track retry attempts in after_scenario.

Call this in your after_scenario in environment.py.

With the patched Scenario.run, the retry loop is handled automatically. This hook is kept for backward compatibility and tracks the attempt count on the context.

:param context: Behave context object. :param scenario: The behave scenario that just finished.