unittest: Proposal to add failUnlessNear

John Roth newsgroups at jhrothjr.com
Tue Jul 20 17:03:39 EDT 2004


"Tim Peters" <tim.peters at gmail.com> wrote in message
news:mailman.608.1090290718.5135.python-list at python.org...
> [John Roth]
> > I think this is overkill. I find myself using a raw assert much of the
time
> > rather than unittest's specific test methods; it works just as well and
I
> > don't have to remember the blasted syntax!
>
> It doesn't work as well, because assert stmts "vanish" when running
> tests with -O.

I'm not sure why I'd ever want to bother compiling
my test modules with -O. (In fact, I'm not sure what
-O does any more. I'm sure it does something besides
removing asserts, but I don't know what.)

John Roth






More information about the Python-list mailing list