Ending the test on failed assertions #153
-
So i tried something yesterday that really surprised me: func test_something():
assert_that(9).is_equal(10)
assert_that(11).is_equal(10) I would have expected that after the first assertion failed the test would not continue to run. However the test continues. This can be ok in some cases but in other cases (especially integration tests) it doesn't make sense to continue the test if an assertion fails. I suspect because of the way GdScript works, that it is actually not possible to halt execution on a failed assertion, simply because GdScript has no exceptions. So I wonder if you know a good way of handling such situations, such that tests can fail fast on the first failed assertion? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes i can confirm this behavior and yes the nature of GdScript not allowes to stop at the first error. If you have an idea how to stop the current execution on the first failure let me now. |
Beta Was this translation helpful? Give feedback.
Yes i can confirm this behavior and yes the nature of GdScript not allowes to stop at the first error.
This should not be a problem in general, but yes fail fast would be the best.
If you have an idea how to stop the current execution on the first failure let me now.
Using threads could be a option, but i stopped to use threads because of debug issues when using threads.
godotengine/godot#42901