On Wed, May 2, 2012 at 10:00 AM, kcrisman <kcris...@gmail.com> wrote: > > > On May 2, 11:27 am, Simon King <simon.k...@uni-jena.de> wrote: >> Hi Marco, >> >> On 2 Mai, 16:41, mmarco <mma...@unizar.es> wrote: >> >> > Do i have to write documentation strings, >> > with the corresponding doctest for all these functions? Even for >> > trivial ones such as _repr_ or _latex_? >> >> Yes. In these cases, the method definition plus doc string would >> likely look like >> >> def _repr_(self): >> """ >> TESTS:: >> >> sage: B = <some command to create a braid> >> sage: B # indirect doctest >> <the representation of B> >> """ >> >> Note the "indirect doctest", which is important, since otherwise the >> coverage script will complain about the fact that the name of the to- >> be-tested method ("_repr_") does not occur in the test. >> > > Yup, and same for things like _pow_ as you say. On the plus side, it > can really be as trivial as that - just repeat some other doctest > where it is used.
Why? Just to improve the coverage statistic? Best to use this to test at least a new variation. -- 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