Test scenario decorator with a standard usage.
(pytester, pytest_params)
| 123 | |
| 124 | |
| 125 | def test_simple(pytester, pytest_params): |
| 126 | """Test scenario decorator with a standard usage.""" |
| 127 | pytester.makefile( |
| 128 | ".feature", |
| 129 | simple=""" |
| 130 | Feature: Simple feature |
| 131 | Scenario: Simple scenario |
| 132 | Given I have a bar |
| 133 | """, |
| 134 | ) |
| 135 | pytester.makepyfile( |
| 136 | """ |
| 137 | from pytest_bdd import scenario, given, then |
| 138 | |
| 139 | @scenario("simple.feature", "Simple scenario") |
| 140 | def test_simple(): |
| 141 | pass |
| 142 | |
| 143 | @given("I have a bar") |
| 144 | def _(): |
| 145 | return "bar" |
| 146 | |
| 147 | @then("pass") |
| 148 | def _(): |
| 149 | pass |
| 150 | """ |
| 151 | ) |
| 152 | result = pytester.runpytest_subprocess(*pytest_params) |
| 153 | result.assert_outcomes(passed=1) |
| 154 | |
| 155 | |
| 156 | def test_angular_brackets_are_not_parsed(pytester): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…