On Tue, Apr 27, 2010 at 5:16 PM, Barry Warsaw <[email protected]> wrote:
> On Apr 27, 2010, at 02:40 PM, [email protected] wrote: > > >On 01:38 pm, [email protected] wrote: > > >> 2) have unit tests that fail before the patch and succeed after > > > >This list would make a good addition to one of the cpython development > >pages. If potential contributors could find this information, then > >they'd be much more likely to participate by doing reviews. > > It would be kind of cool if there were some best practices for running said > unittest both with and without the patch enabled. Kind of like using > #ifdefs > in C but without all the commenting-out-commenting-in error proneness. I > guess you could do something like > > if os.getenv('BUG1234'): > # Patch the frobnicator to not bloviate. > > When I'm writing the patch it's usually easy, I write the tests, see that they fail, write the fix, see that they pass. When I'm reviewing the patch, I apply the patch, see that the tests pass, svn revert the fix, check that they fail. Most of the patches affect just a couple of files, so applying the whole patch and then revert is usually trivial and probably easier than having to deal with two separate files for patch and tests.
_______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
