unittest vs py.test?

Terry Reedy tjreedy at udel.edu
Sun Apr 3 18:31:27 EDT 2005


"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message 
news:7x3bu8t7or.fsf at ruckus.brouhaha.com...
> "Raymond Hettinger" <vze4rx4y at verizon.net> writes:
>> When writing a large suite, you quick come to appreciate being able
>> to use assert statements with regular comparision operators, debugging
>> with normal print statements, and not writing self.assertEqual over and
>> over again.  The generative tests are especially nice.
>
> But assert statements vanish when you turn on the optimizer.  If
> you're going to run your application with the optimizer turned on, I
> certainly hope you run your regression tests with the optimizer on.

I don't see why you think so.  Assertion statements in the test code make 
it harder, not easier for the test to pass.  Ditto, I believe, for any in 
the run code, if indeed there are any.

Terry J. Reedy






More information about the Python-list mailing list