On Tuesday 02 April 2002 01:21 pm, Jeffrey P Shell wrote:
> - (1) You can sometimes get a decent (but not huge) speed increase
> running Python in optimized mode, but since the 'assert' statement is
> basically a debugging statement, they get deleted from the optimized
> .pyo files.  This isn't a bad thing - if all of the assertions have
> succeeded for a good amount of time, why waste cycles depending on
> them in a deployment situation?

Guido has said that in the future, removal of assert statements and the 
optimization setting, will be separated. So perhaps this is of minor 
importance.


> (2) The default exception raised by PyUnit is AssertionError, and I
> used to see (and write) many unit tests using the 'assert' statement.
>  I've seen a few debates, primarily stemming from the PythonLabs
> group, about whether this is right, and I've been convinced that it
> isn't - if an assertion fails inside of tested code, you want to
> isolate that from normal test failures. Fortunately, PyUnit (at

I've heard this before but keep missing the explanation of why an 
"assert" in the code has to be separated from an assert in the unit 
test. I've been using asserts in my unit tests for quite awhile and 
never experienced any headaches.

Do you have any insights into that?

-Chuck

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to