[SciPy-dev] Fwd: [sage-devel] numpy in SAGE, etc.

Jonathan Guyer guyer at nist.gov
Fri Dec 8 09:37:10 EST 2006


On Dec 8, 2006, at 3:27 AM, David Cournapeau wrote:

>
>>> I'd
>>> also specify some way of delineating examples so that they can be
>>> preprocessed and run as part of the unit tests.
>>
>> You mean like doctest?
> Ha, thank you for this information, I always wondered if this was  
> possible.

Possible and really desirable. We've pretty much gotten rid of all  
our other unittests. doctests (including our full example scripts)  
cover all the things our old unittest suites did, and a great deal  
more, and they're a lot easier to write, read, and maintain.

> Is there a preferred way to do that for unit testing ?

I'm not sure exactly what you mean by this. If you mean, how do you  
go about integrating doctest with unittest, then the work's already  
done for you. doctest.DocTestSuite(module) returns a TestSuite  
suitable for unittest.

FiPy adds a bunch of infrastructure to delay the actual imports when  
we test our entire codebase. I'll need to go back and see if this is  
still necessary, but we found that import failures in one or another  
non-essential part of FiPy would cause the entire test suite to fail  
to build, rather than just reporting test failures on that one bit.  
We may not need this, anymore, though, because those failed imports  
were biting us in other circumstances, so we've moved the imports of  
optional modules into the functions where they're actually invoked,  
instead of at the head of their modules. Regardless, we're happy to  
share any elements of our test harness that seem useful to SciPy.



More information about the SciPy-Dev mailing list