-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Adds TestSuite(object).run() generic testing framework #6343
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
Change the name from obj.check() to obj._check(). It is not reasonable that if one does obj. on any Sage object, one sees check. William |
comment:4
Change the name from obj.check() to obj._check(). It is not reasonable that if one does obj. on any Sage object, one sees check. |
Changed keywords from none to testunit |
This comment has been minimized.
This comment has been minimized.
comment:6
Patch reworked, after the discussion on sage-devel. Note: After peeking again into the testunit framework, I finally went for TestSuite(object).run() which The otherwise discussed functionality TestSuite(object).associativity() will be implemented in a later patch |
This comment has been minimized.
This comment has been minimized.
comment:8
I like the new design and class/function names. |
comment:9
Attachment: trac_6343-sage_object-test-nt.patch.gz Oops, the doctests were broken (I had forgotten to rename stuff in there) |
Reviewer: Mike Hansen |
comment:10
Looks good to me. We just have to make sure to re-enable the missing tests when the category stuff is added. |
Changed author from nthiery to Nicolas Thiery |
Changed author from Nicolas Thiery to Nicolas M. Thiéry |
comment:11
Thanks for the review! |
comment:12
No worries. I really should just add key tomy keyboard layout :-) |
reviewer patch; fixes typos and docstring formatting |
Changed reviewer from Mike Hansen to Mike Hansen, Minh Van Nguyen |
comment:13
Attachment: trac_6343-reviewer.patch.gz The patch Apart from that, here's a small issue. Can you provide examples and/or tests for the function |
comment:14
Attachment: trac_6343-reviewer-nt.patch.gz Replying to @sagetrac-mvngu:
Agreed, that's better (but not for that argument: my opinion is that _* methods, or at least * and * methods should show up in the manual; but that's another discussion). Thanks for your doc fixes! I double checked them.
Thanks also for spotting the missing doctest. The attached patch fixes this. |
comment:17
Everything looks good to me now. Apply all patches. |
Merged: Sage 4.1.2.alpha2 |
comment:18
Merged patches in this order:
|
comment:19
Thanks Mike, thanks Minh! |
This patch implements TestSuite(object).run() which runs
systematic checks on the object. Here is a typical call:
In practice, TestSuite(o).run() runs all the methods named test* of the object o.
The test* methods are typically implemented by abstract super classes
and in particular via categories, in order to enforce standard
behavior and API (_test_pickling, _test_an_element), or provide
mathematical sanity checks (_test_associativity).
For consistent error reporting, the test* methods in turn must use
the new gadget sage.misc.sage_unittest.InstanceTester to actually
run the tests.
This is used by the category patches #5891 and followers
CC: @sagetrac-sage-combinat @sagetrac-cwitty @roed314 @saliola @sagetrac-mvngu
Component: doctest coverage
Keywords: testunit
Author: Nicolas M. Thiéry
Reviewer: Mike Hansen, Minh Van Nguyen
Merged: Sage 4.1.2.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/6343
The text was updated successfully, but these errors were encountered: