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

Function test_improper_step_error

tests/parser/test_errors.py:190–215  ·  view source on GitHub ↗

Test improper step without keyword.

(pytester)

Source from the content-addressed store, hash-verified

188
189
190def test_improper_step_error(pytester):
191 """Test improper step without keyword."""
192 features = pytester.mkdir("features")
193 features.joinpath("test.feature").write_text(
194 textwrap.dedent(
195 """
196 Feature: Feature with improper step
197 Scenario: Scenario with improper step
198 Given a valid step
199 InvalidStep I have an invalid step
200 """
201 ),
202 encoding="utf-8",
203 )
204 pytester.makepyfile(
205 textwrap.dedent(
206 """
207 from pytest_bdd import scenarios
208
209 scenarios('features')
210 """
211 )
212 )
213
214 result = pytester.runpytest()
215 result.stdout.fnmatch_lines(["*TokenError: Unexpected token found. Check Gherkin syntax near the reported error.*"])
216
217
218def test_improper_initial_keyword(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…