Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know how to solve your problem for doctests, but if you're otherwise feeling limited by doctests you may be better served by Python's more heavy-duty unittest framework. If you used this framework, your tests would be in different files to the code and you shouldn't have problems like this (I think!). Note the "see also" box near the top of the unittest page for even more alternative testing frameworks (though most of those are not built in to sage).