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

Function test_step_trace

tests/feature/test_report.py:19–272  ·  view source on GitHub ↗

Test step trace.

(pytester)

Source from the content-addressed store, hash-verified

17
18
19def test_step_trace(pytester):
20 """Test step trace."""
21 pytester.makefile(
22 ".ini",
23 pytest=textwrap.dedent(
24 """
25 [pytest]
26 markers =
27 feature-tag
28 scenario-passing-tag
29 scenario-failing-tag
30 """
31 ),
32 )
33 feature = pytester.makefile(
34 ".feature",
35 test=textwrap.dedent(
36 """
37 @feature-tag
38 Feature: One passing scenario, one failing scenario
39
40 @scenario-passing-tag
41 Scenario: Passing
42 Given a passing step
43 And some other passing step
44
45 @scenario-failing-tag
46 Scenario: Failing
47 Given a passing step
48 And a failing step
49
50 Scenario Outline: Outlined
51 Given there are <start> cucumbers
52 When I eat <eat> cucumbers
53 Then I should have <left> cucumbers
54
55 Examples:
56 | start | eat | left |
57 | 12 | 5 | 7 |
58 | 5 | 4 | 1 |
59 """
60 ),
61 )
62 relpath = feature.relative_to(pytester.path.parent)
63 pytester.makepyfile(
64 textwrap.dedent(
65 """
66 import pytest
67 from pytest_bdd import given, when, then, scenarios, parsers
68
69 @given('a passing step')
70 def _():
71 return 'pass'
72
73 @given('some other passing step')
74 def _():
75 return 'pass'
76

Callers

nothing calls this directly

Calls 1

OfTypeClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…