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