File: issue0064.feature

package info (click to toggle)
behave 1.2.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,160 kB
  • sloc: python: 19,857; makefile: 137; sh: 18
file content (97 lines) | stat: -rw-r--r-- 2,702 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@issue
Feature: Issue #64 Exit status not set to 1 even there are failures in certain cases

  The behave exit status not always returns 1 when failure(s) occur.
  The problem was associated with the Feature.run() logic implementation.

  This problem was first discovered while verifying issue #52 (see comments).
  See also similar test when tags select a subset of scenarios.

  RELATED ISSUES:
    * issue #52

  Background: Test Setup
    Given a new working directory
    Given a file named "features/steps/steps.py" with:
      """
      from behave import given

      @given(u'passing')
      def step(context):
          pass

      @given(u'failing')
      def step(context):
          assert False, "failing"
      """

  Scenario: Failing in First Scenario
    Given a file named "features/issue64_case1.feature" with:
      """
      Feature: Failing in First Scenario
        Scenario:
          Given failing

        Scenario:
          Given passing
      """
    When I run "behave --format=plain features/issue64_case1.feature"
    Then it should fail with:
      """
      0 features passed, 1 failed, 0 skipped
      1 scenario passed, 1 failed, 0 skipped
      """

  Scenario: Failing in Middle Scenario
    Given a file named "features/issue64_case2.feature" with:
      """
      Feature: Failing in Middle Scenario
        Scenario:
          Given passing
        Scenario:
          Given failing
        Scenario:
          Given passing
      """
    When I run "behave --format=plain features/issue64_case2.feature"
    Then it should fail with:
      """
      0 features passed, 1 failed, 0 skipped
      2 scenarios passed, 1 failed, 0 skipped
      """

  Scenario: Failing in Last Scenario
    Given a file named "features/issue64_case3.feature" with:
      """
      Feature: Failing in Last Scenario
        Scenario:
          Given passing
        Scenario:
          Given passing
        Scenario:
          Given failing
      """
    When I run "behave --format=plain features/issue64_case3.feature"
    Then it should fail with:
      """
      0 features passed, 1 failed, 0 skipped
      2 scenarios passed, 1 failed, 0 skipped
      """

  Scenario: Failing in First and Last Scenario
    Given a file named "features/issue64_case4.feature" with:
      """
      Feature: Failing in First and Last Scenario
        Scenario:
          Given failing
        Scenario:
          Given passing
        Scenario:
          Given failing
      """
    When I run "behave --format=plain features/issue64_case4.feature"
    Then it should fail with:
      """
      0 features passed, 1 failed, 0 skipped
      1 scenario passed, 2 failed, 0 skipped
      """