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
improve error reporting in some tests #13975
Comments
comment:2
You missed a test for Best, Travis |
comment:3
Attachment: cnatestfail.patch.gz Replying to @tscrim:
I have now changed the failure message in the associativity test case and also fixed the doctest in Cheers, |
comment:4
Looks good to me now. Thank you. Best, Travis |
This comment has been minimized.
This comment has been minimized.
Reviewer: Travis Scrimshaw |
comment:5
I don't necessarily agree. The right way to access the failing elements is to use post mortem introspection with the debugger, as described in TestSuite. I agree it is a little improvement if the elements are printed right away. However, with the current patch, this does reduce the lisibility of the test function: I want the mathematical test to be written in a way that is as close as possible to the math. Cheers, |
comment:6
Replying to @nthiery:
I suggested this patch because it would have saved me a lot of time recently. Now you're saying we can't have more helpful error messages because
is so much more readable than
Frankly, I find this un peu ridicule... Cheers, Christian |
comment:7
Replying to @cnassau:
Sorry for being picky, but I handcrafted this piece of code with much The rationale above assumes that someone encountering such errors is a That being said, I totally support efforts in the following
I guess I can live, for the most used tests, with an idiom like:
to make the learning curve a bit smoother. Or even
But please make sure that the formula is well highlighted. If you want to see some non trivial examples where we simply can't Cheers, |
comment:8
Hi Nicolas, Thank you very much for these explanations - you've clearly put a lot of work and thought into these issues so I won't argue with you. But do I understand you correctly, that tester.assert_( (x * y) * z == x * (y * z) ,
LazyFormat("(x*y)*z != x*(y*z) for (x,y,z) = (%s,%s,%s)") % (x,y,z) ) would find your approval? Because I then just might re-format my patch in this style and set it to "need review" again... ;-) Cheers, Christian |
comment:9
Replying to @cnassau:
Oops, sorry, I let that slip away in my mailbox. Yes, that would be alright indeed! |
In case of failure the routines
_test_associativity
_test_distributivity
_test_one
_test_prod
should report the elements that failed.
The attached patch just enhances the error messages and adds some test cases similar to the following:
Component: categories
Author: Christian Nassau
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/13975
The text was updated successfully, but these errors were encountered: