Skip to content

Commit

Permalink
Merge pull request #723 from pytest-dev/remove-strict
Browse files Browse the repository at this point in the history
Fix references to "strict" options
  • Loading branch information
youtux authored Oct 19, 2024
2 parents a10b5a4 + 4b437c7 commit 6503691
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 114 deletions.
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ scenario test, so we can use standard test selection:
pytest -m "backend and login and successful"
The feature and scenario markers are not different from standard pytest markers, and the ``@`` symbol is stripped out automatically to allow test selector expressions. If you want to have bdd-related tags to be distinguishable from the other test markers, use a prefix like ``bdd``.
Note that if you use pytest with the ``--strict`` option, all bdd tags mentioned in the feature files should be also in the ``markers`` setting of the ``pytest.ini`` config. Also for tags please use names which are python-compatible variable names, i.e. start with a non-number, only underscores or alphanumeric characters, etc. That way you can safely use tags for tests filtering.
Note that if you use pytest with the ``--strict-markers`` option, all Gherkin tags mentioned in the feature files should be also in the ``markers`` setting of the ``pytest.ini`` config. Also for tags please use names which are python-compatible variable names, i.e. start with a non-number, only underscores or alphanumeric characters, etc. That way you can safely use tags for tests filtering.

You can customize how tags are converted to pytest marks by implementing the
``pytest_bdd_apply_tag`` hook and returning ``True`` from it:
Expand Down Expand Up @@ -892,8 +892,6 @@ About best practices for Background, please read Gherkin's
related to actions and consuming outcomes; that is in conflict with the
aim of "Background" - to prepare the system for tests or "put the system
in a known state" as "Given" does it.
The statement above applies to strict Gherkin mode, which is
enabled by default.


Reusing fixtures
Expand Down
111 changes: 0 additions & 111 deletions tests/feature/test_no_strict_gherkin.py

This file was deleted.

0 comments on commit 6503691

Please sign in to comment.