elchupanebrej / pytest-bdd-ng

BDD library for the py.test runner
https://pytest-bdd-ng.readthedocs.io/en/default/
Other
14 stars 3 forks source link

The --gherkin-terminal-reporter option only works if you add '-vv' #101

Closed The-BDD-Coach closed 10 months ago

The-BDD-Coach commented 10 months ago

The '--gherkin-terminal-reporter ' command line option doesn't work as expected; it produces this:

% pytest --gherkin-terminal-reporter    
================= test session starts =================
platform darwin -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
rootdir: /Users/.../Development/pytest-bdd-ng/tests
plugins: bdd-ng-2.0.1
collected 8 items                                                                                                                                                           

Features/library_catalog_searches.feature ........                [100%]

================= 8 passed in 0.01s =================

When I add '-vv', it does produce the expected result:

% pytest --gherkin-terminal-reporter -vv
================= test session starts =================
platform darwin -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0 -- ~/.pyenv/versions/3.11.5/envs/pytest/bin/python3.11
cachedir: .pytest_cache
rootdir: ~/Development/pytest-bdd-ng/tests
plugins: bdd-ng-2.0.1
collected 8 items                                                                                                                                                           

Features/library_catalog_searches.feature::test_scenarios[file:Features/library_catalog_searches.feature-Library book searches and book delivery-The catalog can be searched by author name.] <- ../../../.pyenv/versions/3.11.5/envs/pytest/lib/python3.11/site-packages/pytest_bdd/scenario.py 
Feature: Library book searches and book delivery
    Scenario: The catalog can be searched by author name.
        Given these books in the catalog (PASSED)
        When a name search is performed for Stephen (PASSED)
        Then only these books will be returned (PASSED)
    PASSED
.
.
.

================= 8 passed in 0.02s =================
elchupanebrej commented 10 months ago

This was done intentionally; Chesterton's fence principle applied; Documentation was updated https://github.com/elchupanebrej/pytest-bdd-ng/blob/default/tests/feature/test_gherkin_terminal_reporter.py