Hi Andrey, John!

I somehow never received this discussion of yours on sage-devel, and
stumbled on it while browsing trac. Time to answer!

> Sometime in May 2010, John said on sage-devel:
> On 16 May 2010 17:52, Andrey Novoseltsev <novos...@gmail.com> wrote:
> > If I add a new file into Sage without TestSuite(...).run(), then "sage
> > -coverage" shows an "ERROR" for this file. Does this mean that a patch
> > without such a test has no chances to be merged? I really hope this is
> > not the case yet...
> 
> > I think that TestSuite is an awesome idea and it did help me to fix
> > some potential bugs. However when I derive from existing classes that
> > have no TestSuite testing, it seems that my class is blamed for all
> > the errors and inconsistencies of these existing classes. Of course,
> > they also should be fixed, but it may not be very clear how.
> 
> > In particular, can anyone give me a hint what should I do with the
> > following (my class has the same error):
> 
> > P2 = ProjectiveSpace(2, QQ)
> > e = P2(1,1,1)
> > e._test_category()
> 
> > Traceback (most recent call last):
> >  ...
> >  File "element.pyx", line 472, in
> > sage.structure.element.Element._test_category (sage/structure/
> > element.c:3676)
> >  File "/home/novoselt/sage/local/lib/python/unittest.py", line 325,
> > in failUnless
> >    if not expr: raise self.failureException, msg
> > AssertionError
> 
> > I have also discovered that even this fails (in Sage 4.4):
> 
> > TestSuite(QQ[x]).run()
> 
> > Thank you!
> > Andrey
>
> I had noticed that, after bringing a coupld of files up to 100%
> coverage, it was annoying to get this Error message.
> 
> There seems to be nothing about TestSuite in the developers guide, so
> it cannot (yet) be a requirement to implement it!
> 
> After  trying TestSuite? I found the page in the reference manual
> (under Miscellaneous, in the section Unit testing for Sage objects).
> But if this is intended to be a requirement, or even a desirable
> feature of every Sage class, there needs to be some better instruction
> on what to do.

The coverage script previously requested a loads/dumps test, and I
replaced it by a TestSuite test. My point of view is indeed that every
class implemented in Sage should be tested with a TestSuite run.

Now I totally agree that it is very annoying when working hard to
improve the test coverage for a class to get "blamed" for all the
issues that the TestSuite call uncovers. So in such a situation, I
find totally acceptable to use:

        sage: TestSuite(S).run(skip = ["_test_blah", "_test_blih"]) # see trac 
#10307

where #10307 would be a new ticket requesting to fix the failing test
in a later patch. Sage is better off with a new TestSuite call that:

 - documents what does not work yet and feels itchy, which is good:
   someone will eventually want to  scratch that itch
 - is ready to catch other regressions

than without.

John: do you see a good place in the developpers manual where to add
the above comments?

Cheers,
                                Nicolas
--
Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to