Why don't you, instead of collecting all the booleans in a list,
assert each one?

On 23 April 2010 13:55, ablondin <alexandre.blondin.ma...@gmail.com> wrote:
> Hello, everyone !
> What is the right syntax to include a test like this one in the
> docstring ?
>

Delete this line:

> sage: valid = []

Keep this:

> sage: for i in range(1,10):
> sage:     for j in range(1,10):
> sage:         if i != j:
> sage:             w = words.KolakoskiWord(alphabet=(i,j))

Replace these two

> sage:             valid.append(w[:50] == w.delta()[:50])
> sage: all(valid)

with

sage:               assert append(w[:50] == w.delta()[:50]

There is no output if all is well;  otherwise an AssertionError will be raised.

John


> True
>
> I can't find any reference to that in the documentation.
> Thank you for your help.
> Alex
>
> --
> 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
>

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