Skip to content

Commit cd93d4d

Browse files
authored
Merge branch 'master' into multiline-tags
2 parents 4012e69 + 36c3fa4 commit cd93d4d

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,28 @@ jobs:
8888
token: ${{ secrets.CODECOV_TOKEN }}
8989
fail_ci_if_error: false
9090
verbose: true # optional (default = false)
91+
92+
pypi-publish:
93+
name: Upload release to PyPI
94+
runs-on: ubuntu-latest
95+
environment:
96+
name: pypi
97+
url: https://pypi.org/p/pytest-bdd
98+
permissions:
99+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
100+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
101+
needs: test-run
102+
steps:
103+
- uses: actions/checkout@v4
104+
- name: Set up Python
105+
uses: actions/setup-python@v5
106+
- name: Install pypa/build
107+
run: >-
108+
python3 -m
109+
pip install
110+
build
111+
--user
112+
- name: Build a binary wheel and a source tarball
113+
run: python3 -m build
114+
- name: Publish package distributions to PyPI
115+
uses: pypa/gh-action-pypi-publish@release/v1

CHANGES.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ Changelog
33

44
Unreleased
55
----------
6-
- Use `gherkin-official` parser to replace custom parsing logic.
6+
7+
8.0.0b1
8+
----------
9+
- Use `gherkin-official` parser to replace custom parsing logic. This will make pytest-bdd more compatible with the Gherkin specification.
710
- Multiline steps must now always use triple-quotes for the additional lines.
811
- All feature files must now use the keyword `Feature:` to be considered valid.
912
- Tags can no longer have spaces (e.g. "@tag one" "@tag two" are no longer valid).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pytest-bdd"
3-
version = "7.3.0"
3+
version = "8.0.0b1"
44
description = "BDD for pytest"
55
authors = ["Oleg Pidsadnyi <[email protected]>", "Anatoly Bubenkov <[email protected]>"]
66
maintainers = ["Alessio Bogon <[email protected]>"]

tests/feature/test_steps.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,3 +620,36 @@ def _(stuff):
620620
"*Tearing down...*",
621621
]
622622
)
623+
624+
625+
def test_right_aligned_steps(pytester):
626+
"""Parser correctly handles steps that are not left-aligned"""
627+
pytester.makefile(
628+
".feature",
629+
right_aligned_steps="""\
630+
Feature: Non-standard step indentation
631+
Scenario: Indent my steps
632+
Given I indent with 4 spaces
633+
Then I indent with 5 spaces to line up
634+
""",
635+
)
636+
pytester.makepyfile(
637+
textwrap.dedent(
638+
"""\
639+
from pytest_bdd import given, then, scenarios
640+
641+
scenarios("right_aligned_steps.feature")
642+
643+
@given("I indent with 4 spaces")
644+
def _():
645+
pass
646+
647+
@then("I indent with 5 spaces to line up")
648+
def _():
649+
pass
650+
651+
"""
652+
)
653+
)
654+
result = pytester.runpytest()
655+
result.assert_outcomes(passed=1, failed=0)

0 commit comments

Comments
 (0)