-
Notifications
You must be signed in to change notification settings - Fork 440
Closed
Labels
Component: Bash CodeEverything regarding the bash codeEverything regarding the bash codePriority: CriticalBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorSize: MediumChanges in the same fileChanges in the same fileType: Bug
Milestone
Description
Describe the bug
Currently, the behavior of Bats w.r.t. an error in teardown varies depending on the location of the failure, whether its the last command or in the middle.
To Reproduce
Run the following scripts and compare their output:
@test "test to make bats run this file" { :; }
teardown() {
false
}
will trigger an error:
$ ./bin/bats test.bats
test.bats
✗ test to make bats run this file
(from function `teardown' in test file test.bats, line 4)
`false' failed
1 test, 1 failure
while
@test "test to make bats run this file" { :; }
teardown() {
false
true
}
does not:
$ ./bin/bats test.bats
test.bats
✓ test to make bats run this file
1 test, 0 failures
Expected behavior
Both files should generate the same output.
Environment (please complete the following information):
Seems to be present from bats version 1.0.0 onwards (earlier not tested)
Metadata
Metadata
Assignees
Labels
Component: Bash CodeEverything regarding the bash codeEverything regarding the bash codePriority: CriticalBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorSize: MediumChanges in the same fileChanges in the same fileType: Bug