Test improper step without keyword.
(pytester)
| 188 | |
| 189 | |
| 190 | def 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 | |
| 218 | def test_improper_initial_keyword(pytester): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…