Brian Curtin <cur...@acm.org> added the comment: I've attached a patch against trunk (r76107) which I think implements more of what Antoine is looking for. It builds on Collin's patch but uses unittest.skipIf to skip tests which shouldn't be run with -OO. It also checks sys.flags.optimize in DocTestSuite and returns a suite with a single skipped test as a placeholder in the case that -OO is used.
One thing that isn't really clean is that test_docxmlrpc has two skipped tests and requires work to be done in the tearDown method after those methods are skipped. Since setUp gets called even when the test will be skipped, the server is started and blocking on getting a request, so I just figure out if the test was skipped and do a request for it. Maybe that's acceptable, I'm not sure. If anyone has a better way to figure get around that, I'm all ears. For comparison's sake, regrtest with -OO on r76107 results in 297 OK and 17 failed, and without optimize it results in 311/2. The patch results in 311 OK and 2 failed for runs of regrtest both optimized and not, and you can see the improvements more clearly when running the module-level tests which were modified. ---------- nosy: +brian.curtin Added file: http://bugs.python.org/file15258/issue6292_20091104_v1.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6292> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com