On Fri, Jan 23, 2015 at 9:45 AM, Chris Angelico <rosuav@gmail.com> wrote:
> And the unitest is very vested in
> it's OO structure -- would we want add free-form functions to it?

Updating the assertion to use the new function would be a matter of
tweaking the implementation of unittest's assertAlmostEqual() to now
call this function and assert that it returns True.

sure -- that's not quite what I meant. I was really addressing the "where would this sit" question.

unittest does not currently have any stand-alone utility functions for testing in it. If we put this there, would anyone think to look for it there?
 
 I'd say that's a point worth mentioning in the
PEP.

well, whether to change a TestCase assertion or add a new one is a brand new question -- we could add that to this PEP if people think that's a good idea. For my part, I find unittest painful, and use py.test (and sometimes nose) anyway....
 
it would be worth adding a word or two of docs to unittest stating
that assertAlmostEqual is not the same as is_close_to (and/or add
"assertCloseTo" which would use it), as the existing implementation is
all about absolute difference.

probably a good idea, yes.

I really don't think we want to change assertAlmostEqual -- certainly not anytime soon. It seems like gratuitous backward incompatibility.

-Chris



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov