Skip to content

Print tags in gherkin-terminal-reporter output#799

Open
Nikolay-Chillev wants to merge 1 commit intopytest-dev:masterfrom
Nikolay-Chillev:feature/print-tags-in-terminal-reporter
Open

Print tags in gherkin-terminal-reporter output#799
Nikolay-Chillev wants to merge 1 commit intopytest-dev:masterfrom
Nikolay-Chillev:feature/print-tags-in-terminal-reporter

Conversation

@Nikolay-Chillev
Copy link
Copy Markdown

@Nikolay-Chillev Nikolay-Chillev commented Mar 26, 2026

Summary

Display feature, scenario, and rule tags in the terminal reporter when using --gherkin-terminal-reporter with -v or -vv verbosity.

Closes #476

Changes

  • Added _format_tags() helper function to format tag lists with @ prefix
  • Modified -v mode output to show tags after feature, scenario, and rule names
  • Modified -vv mode output to show tags after feature, scenario, and rule names
  • Added 2 new tests verifying tag display in both verbosity modes

Example output

$ pytest --gherkin-terminal-reporter -v

Feature: Tagged feature @feature-tag
    Scenario: Tagged scenario @scenario-tag-1 @scenario-tag-2 PASSED
$ pytest --gherkin-terminal-reporter -vv

Feature: Tagged feature @feature-tag
    Scenario: Tagged scenario @scenario-tag-1 @scenario-tag-2
        Given there is a bar
        When the bar is accessed
        Then world explodes
    PASSED

Test plan

  • All 16 existing + new reporter tests pass
  • Tags displayed correctly in -v mode
  • Tags displayed correctly in -vv mode
  • Feature, scenario, and rule tags all supported
  • No tags shown when none exist (no regression)

Display feature, scenario, and rule tags in the terminal reporter
when using --gherkin-terminal-reporter with -v or -vv.

Tags are shown after the feature/scenario/rule name with @ prefix,
matching the Gherkin syntax convention.

Closes pytest-dev#476
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.

print tags in gherkin-terminal-reporter

1 participant