You can still doctest it. In doctest mode, show() should just produce
a png (or something like that) but not pop it up. We don't have a way
of telling now if it produces the correct image(s), but at least we
can make sure it doesn't raise an exception.
- Robert
On Thu, Oct 8, 2009 at 6:32 AM, Simon King <simon...@nuigalway.ie> wrote:
> However, back to the question on pictures: I understood Robert's hint
> such that I do not need to explicitly produce (and save) a png. So, do
> I understand correctly that
> sage: show(B)
> will be a valuable doc test for an instance B of a class with a show()
> method?
It depends on how your show is implemented. There is a variable
sage.plot.plot.DOCTEST_MODE which is set to True if things are running
in a doctest. The show method on Graphics objects knows about this
and will produce a PNG. If your show implementation calls
Graphics.show, then you don't need to do anything; otherwise, you'll
probably want to save a temporary PNG of DOCTEST_MODE is set to True.
--Mike