Skip to content
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

[Feature Request] More precise assertation failure information need to be provided #2379

Closed
1 task done
zhoujingya opened this issue Apr 22, 2024 · 3 comments
Closed
1 task done
Assignees
Labels
enhancement New feature or request mojo-repo Tag all issues with this label

Comments

@zhoujingya
Copy link

zhoujingya commented Apr 22, 2024

Review Mojo's priorities

What is your request?

when I worked on #2378, I wrote some test cases, but the assertation failure only told me i failed my test, but I didn't know the error line and column

Unhandled exception caught during execution: AssertionError: condition was unexpectedly False
mojo: error: execution exited with a non-zero result: 1

when we added too many test cases later, I think it was not friendly for our developers to find the precise source code information

What is your motivation for this change?

More precise assertation failure information

Any other details?

No response

@zhoujingya zhoujingya added enhancement New feature or request mojo Issues that are related to mojo labels Apr 22, 2024
@zhoujingya zhoujingya changed the title [Feature Request] More precise assertation error information need to be provided [Feature Request] More precise assertation failure information need to be provided Apr 22, 2024
@gabrieldemarmiesse
Copy link
Contributor

Stacktraces ❤️

@mikowals
Copy link
Contributor

mikowals commented Apr 27, 2024

testing.assert_... functions now print the file and line number when there is a failure. See this commit.

So I think this issue can be closed.

@JoeLoser
Copy link
Collaborator

JoeLoser commented Apr 27, 2024

Yep, I'm going to close this issue as we have the source location now plumbed through in the assert functions. Thanks @laszlokindrat for making this happen! Stack traces from Mojo programs are a whole separate beast. Feel free to open a separate GitHub issue for that, but it's well known internally that users would like that.

@linear linear bot removed the mojo Issues that are related to mojo label Apr 29, 2024
@linear linear bot reopened this Apr 29, 2024
@ematejska ematejska added the mojo-repo Tag all issues with this label label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

6 participants