Changes between Version 1 and Version 5 of Ticket #6343


Ignore:
Timestamp:
06/26/09 08:48:20 (10 years ago)
Author:
nthiery
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6343

    • Property Status changed from new to assigned
    • Property Keywords testunit added
    • Property Summary changed from Adds SageObject.check() generic testing framework to [with patch, needs review] Adds TestSuite(object).run() generic testing framework
  • Ticket #6343 – Description

    v1 v5  
    1 This patch implements a .check() method in SageObject which runs systematic checks on the object. Here is a typical call:
     1This patch implements TestSuite(object).run()  which runs
     2systematic checks on the object. Here is a typical call:
    23
    3      sage: ZZ.check(verbose = True)
    4      running test_an_element ... done
    5      running test_element_pickling ... done
    6      running test_not_implemented_methods ... done
    7      running test_pickling ... done
     4     sage: TestSuite(ZZ).run(verbose = True)
     5     running ._test_an_element() ... done
     6     running ._test_element_pickling() ... done
     7     running ._test_not_implemented_methods() ... done
     8     running ._test_pickling() ... done
    89
    9 In practice, o.check() runs all the methods named test_* of the object o.
     10In practice, TestSuite(o).run() runs all the methods named _test_* of the object o.
     11The _test_* methods are typically implemented by abstract super classes
     12and in particular via categories, in order to enforce standard
     13behavior and API (_test_pickling, _test_an_element), or provide
     14mathematical sanity checks (_test_associativity).
    1015
    11 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).
     16For consistent error reporting, the _test_* methods in turn must use
     17the new gadget sage.misc.sage_unittest.InstanceTester to actually
     18run the tests.
    1219
    13 For consistent error reporting, the test_* methods in turn must use the new gadget sage.misc.instance_tester.InstanceTester to actually run the tests.
    14 
    15 This patch is a prerequisite for #5891 (category framework), which uses it intensively. Some examples in the patch illustrate this, and are therefore temporarily disabled.
     20This is used by the category patches #5891 and followers