File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,51 @@ def _(stuff):
622
622
)
623
623
624
624
625
+ def test_lower_case_and (pytester ):
626
+ pytester .makefile (
627
+ ".feature" ,
628
+ steps = textwrap .dedent (
629
+ """\
630
+ Feature: Step keywords need to be capitalised
631
+
632
+ Scenario: Step keywords must be capitalised
633
+ Given that I'm writing an example
634
+ and that I like the lowercase 'and'
635
+ Then it should fail to parse
636
+ """
637
+ ),
638
+ )
639
+ pytester .makepyfile (
640
+ textwrap .dedent (
641
+ """\
642
+ import pytest
643
+ from pytest_bdd import given, when, then, scenarios
644
+
645
+ scenarios("steps.feature")
646
+
647
+
648
+ @given("that I'm writing an example")
649
+ def _():
650
+ pass
651
+
652
+
653
+ @given("that I like the lowercase 'and'")
654
+ def _():
655
+ pass
656
+
657
+
658
+ @then("it should fail to parse")
659
+ def _():
660
+ pass
661
+
662
+ """
663
+ )
664
+ )
665
+ result = pytester .runpytest ()
666
+ result .assert_outcomes (errors = 1 )
667
+ result .stdout .fnmatch_lines ("*TokenError*" )
668
+
669
+
625
670
def test_right_aligned_steps (pytester ):
626
671
"""Parser correctly handles steps that are not left-aligned"""
627
672
pytester .makefile (
You can’t perform that action at this time.
0 commit comments