Closed keith closed 1 week ago
It would be useful if the error message produced when assert_raises fails, and therefore it raises itself https://github.com/modularml/mojo/blob/f5f5109541c31615a68a3c4b58bd1e75b59625f6/stdlib/src/testing/testing.mojo#L386
assert_raises
included the location of the caller who didn't raise.
Currently if you have a single test file with multiple assert_raises conditions, like this file:
https://github.com/modularml/mojo/blob/f5f5109541c31615a68a3c4b58bd1e75b59625f6/stdlib/test/collections/test_list.mojo#L404-L414
If one of the conditions fails, the error message is just:
Unhandled exception caught during execution: AssertionError: Didn't raise
with no indication of where the assertion is coming from
No response
Review Mojo's priorities
What is your request?
It would be useful if the error message produced when
assert_raises
fails, and therefore it raises itself https://github.com/modularml/mojo/blob/f5f5109541c31615a68a3c4b58bd1e75b59625f6/stdlib/src/testing/testing.mojo#L386included the location of the caller who didn't raise.
What is your motivation for this change?
Currently if you have a single test file with multiple assert_raises conditions, like this file:
https://github.com/modularml/mojo/blob/f5f5109541c31615a68a3c4b58bd1e75b59625f6/stdlib/test/collections/test_list.mojo#L404-L414
If one of the conditions fails, the error message is just:
with no indication of where the assertion is coming from
Any other details?
No response