unittest: Proposal to add failUnlessNear
Antoon Pardon
apardon at forel.vub.ac.be
Tue Jul 20 03:32:53 EDT 2004
Op 2004-07-19, Jeff Epler schreef <jepler at unpythonic.net>:
>
> --8/UBlNHSEJa6utmr
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
>
> On Mon, Jul 19, 2004 at 11:06:47AM +0000, Antoon Pardon wrote:
>> I have been working with unittests lately and found that the
>> self.failUnlessAlmostEqual, isn't as usefull as it could be.
>
> I'd like to hear more about the uses you envision about this,
It can be used with every vectorspace that defines a distance
between vectors.
If someone wants to implement quaternions, he can use this
method to test whether the result is close enough to
what it should be.
Same with vectors or simple complex calculations.
> and
> especially about how to choose "tolerance" properly.
Sorry, but that would require a course in numerical
analysis.
--
Antoon Pardon
More information about the Python-list
mailing list