On 4/2/02 2:51 PM, "Tavis Rudd" <[EMAIL PROTECTED]> wrote:
> How about starting with the distutils stuff? It's one part that > should be fairly easy to isolate and apply to the official codebase > as a patch. I'll do some work on this later this week. I'd > appreciate any comments on the code (thanks Jeff) and the ideas > behind it. > > The test code is a higher priority, but it's alot harder to isolate. I have some comments on this too, at least in regards to unit testing. I see the 'assert' statement used a lot in Webware and related code. It's a good thing to use, but how much code depends on those assertions running all the time? I ask this for a couple of reasons - (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? (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 least, the version in the Python core) seems to let you change the failure exception used to track test failings (where statements in the tests themselves fail, versus in the tested code), so this shouldn't be too big of a deal. I'd recommend making a Webware specific test runner (or subclass of unittest.TestCase) to use for unit tests that use a Webware specific failure exception, and recommend that test authors use the 'assert___()' or 'failUnless___()' methods of PyUnit instead of blanket 'assert' statements. That way, even optimized code could be tested. >> Honestly, I'm not interested in doing all the work myself :) I've >> written and tested these refactorings myself. There's months of >> work in there. Now it's up to other people to at least look at the >> code and comment on it. Then we can decide how to proceed. > > ... lots of thanks to Mike and Geoff who have done quite a bit of > testing and review of this thing over the past half year. -- Jeffrey P Shell www.cuemedia.com _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
