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

Function test_simple

tests/feature/test_scenario.py:125–153  ·  view source on GitHub ↗

Test scenario decorator with a standard usage.

(pytester, pytest_params)

Source from the content-addressed store, hash-verified

123
124
125def 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
156def test_angular_brackets_are_not_parsed(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…