-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with using load
in teardown
#609
Comments
Sounds similar to bats-core/bats-file#40 |
Does this only happen with |
Thanks a lot for responding! It happens without
It did work for a previous version, and I just ran git bisect to find the commit. The result was:
I'll try to look through to see if anything about that commit pops out, but I'm not a bash expert so it will take time. :) |
Okay, I think this reproducer neatly sums up the problem:
executing this prints:
Swapping the two occurrences of false and true will flip around the result too:
This shows that |
When run from the exit trap, `return` without parameter would return the exit code the trap was called with instead of the last command's before `return`.
Thank you so much! For this fix and also generally thanks for bats, we use it in our test set. |
Describe the bug
If we use
load
in theteardown
, bats dies in the run and does not complete.To Reproduce
Steps to reproduce the behavior:
Given this .bats file:
and this test.cpp:
and this common_functions.bash:
And then run bats. What I'm seeing is that it dies before printing what passed or failed:
Expected behavior
Since test.cpp just returns 1, I expect bats to say that the test failed and exit cleanly. If we remove the teardown() function from t.bats it does work as expected:
Environment (please complete the following information):
Additional context
If I'm doing something wrong in the code, let me know! But I thought it should be ok.
The text was updated successfully, but these errors were encountered: