MCPcopy Create free account
hub / github.com/pytest-dev/pytest-bdd / test_right_aligned_steps

Function test_right_aligned_steps

tests/feature/test_steps.py:670–700  ·  view source on GitHub ↗

Parser correctly handles steps that are not left-aligned

(pytester)

Source from the content-addressed store, hash-verified

668
669
670def test_right_aligned_steps(pytester):
671 """Parser correctly handles steps that are not left-aligned"""
672 pytester.makefile(
673 ".feature",
674 right_aligned_steps="""\
675Feature: Non-standard step indentation
676 Scenario: Indent my steps
677 Given I indent with 4 spaces
678 Then I indent with 5 spaces to line up
679 """,
680 )
681 pytester.makepyfile(
682 textwrap.dedent(
683 """\
684 from pytest_bdd import given, then, scenarios
685
686 scenarios("right_aligned_steps.feature")
687
688 @given("I indent with 4 spaces")
689 def _():
690 pass
691
692 @then("I indent with 5 spaces to line up")
693 def _():
694 pass
695
696 """
697 )
698 )
699 result = pytester.runpytest()
700 result.assert_outcomes(passed=1, failed=0)
701
702
703def test_keywords_used_outside_steps(pytester):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…