File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -620,3 +620,36 @@ def _(stuff):
620
620
"*Tearing down...*" ,
621
621
]
622
622
)
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