On Jun 14, 11:46 pm, Florent Hivert <florent.hiv...@univ-rouen.fr>
wrote:
>       Hi,
>
> On Mon, Jun 14, 2010 at 03:13:53PM -0700, daveloeffler wrote:
> > I've been doing some work adding doctests to some files that don't
> > have them, and the coverage script kept telling me to put in a
> > "TestSuite.run()" doctest.
>
> > Can someone tell me how on earth I can get one of these to actually
> > work? No matter what I do, if X is a parent object,
> > "TestSuite(X).run()" always fails at the point where it creates an
> > element of X and runs "_test_category" on it.
>
> 1 - Did you properly initialize category for your parent ? Looking at the code
> from rings/ideal_monoid.py there isn't any category specified for the
> constructor of Ideal_monoid_c.

Of course not, the file long predates the category framework (and the
new coercion model). But I added "category = Monoids()" in the init
method and that didn't help.

> 2 - Did you specify in the parent how the element are represented ? There
> isn't any definition of Element.

That's very precisely what I'm asking: how should I be doing this? I
tried putting in

class IdealMonoid_c:
   ...
   Element = ideal.Ideal_generic

but that doesn't seem to do suffice: now IdealMonoid_c.element_class
is a dynamic subclass of Ideal_generic, but the classes of elements of
an IdealMonoid inherit directly from Ideal_generic; how do I make them
inherit from this magic dynamic class?

I've uploaded what I've got so far at trac #9242. Any suggestions on
how I get the last remaining test to pass would be very welcome.

David

-- 
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