Skip to content

Prevent excluded Behave steps from leaking into results (fixes #902) - #922

Open
liuyaohui666 wants to merge 1 commit into
allure-framework:masterfrom
liuyaohui666:fix/behave-excluded-step-leak
Open

Prevent excluded Behave steps from leaking into results (fixes #902)#922
liuyaohui666 wants to merge 1 commit into
allure-framework:masterfrom
liuyaohui666:fix/behave-excluded-step-leak

Conversation

@liuyaohui666

@liuyaohui666 liuyaohui666 commented Aug 21, 2026

Copy link
Copy Markdown

Context

When AllureFormatter.hide_excluded=True, Behave still reports step declarations for tag-excluded scenarios to the formatter. The listener dropped those scenarios without clearing its pending step queue, so their steps were later attached to the next included scenario.

This change clears pending steps when a scenario is dropped and adds an acceptance test that verifies a selected scenario contains only its own step.

Fixes #902

Checklist

Verification

  • python -m pytest tests/allure_behave -q — 64 passed
  • python -m ruff check allure-behave tests/allure_behave — all checks passed
  • git diff --check HEAD^ HEAD

@CLAassistant

CLAassistant commented Aug 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@liuyaohui666
liuyaohui666 marked this pull request as ready for review August 21, 2026 12:39
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.

[allure-behave] Steps from tag-excluded scenarios bleed into the next matching scenario's result when hide_excluded=true

2 participants