On Nov 24, 11:02 am, Simon King <[EMAIL PROTECTED]> wrote:
> Dear Sage Team,
Hi Simon,
> I know that one can doc test exceptions by
> sage: stupid_code()
> Traceback (most recent call last):
> ...
> TypeError: error message RTFM
>
> My problem: The error message will not always be the same. It is an
> error raised by the Singular interface, the error message will show
> auto-generated variable names -- and the exact name will depend on
> whether the test is "sage -t -long" or "sage -t -optional" or "sage -
> t".
>
> How can I make the error message a black box? I tried
> sage: stupid_code()
> Traceback (most recent call last):
> ...
> TypeError: ...
>
> It didn't work, it resulted in a doc test error.
>
> The Traceback ends with
> TypeError: Singular error:
> ? `COHO3I` is undefined
> ? error occurred in STDIN line 66438: `def sage9606=COHO3I;`
>
> where the names sage9606 and COHO3I are not always the same.
>
> How should the doc test syntax be in that case?
Use the ellipsis operation, i.e. "..." in the following way:
The Traceback ends with
TypeError: Singular error:
? ... is undefined
? error occurred in STDIN line ...: `def ...;`
> Cheers,
> Simon
Cheers,
Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---