File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ Changelog
33
44Unreleased
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).
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " pytest-bdd"
3- version = " 7.3.0 "
3+ version = " 8.0.0b1 "
44description = " BDD for pytest"
55authors = [" Oleg Pidsadnyi <oleg.pidsadnyi@gmail.com>" , " Anatoly Bubenkov <bubenkoff@gmail.com>" ]
66maintainers = [" Alessio Bogon <778703+youtux@users.noreply.github.com>" ]
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments