[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-19 Thread Brett Cannon
New submission from Brett Cannon <[EMAIL PROTECTED]>: Since most UNIX distros don't ship Python's test directory, test.test_support.catch_warning() needs to be moved to the 'warnings' directory so it can be used to suppress warnings in modules outside the 'test' package. The default for 'record'

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Just some quick notes on this. The decorator should become: def catchwarning(*, record=False, using=warnings) Name change is to follow the naming convention in 'warnings' (even though I prefer underscores). The 'using' argument is what modul

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I don't think the using argument should live in warnings; it's too test specific. I recommend we still keep a catch_warning in test_support (or even just test_warnings since this seems to be the only use-case). -- nosy: +benjamin.p

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Wed, Aug 20, 2008 at 10:29 AM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > > I don't think the using argument should live in warnings; it's too test > specific. I recommend we st

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: On Wed, Aug 20, 2008 at 4:51 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Brett Cannon <[EMAIL PROTECTED]> added the comment: > > On Wed, Aug 20, 2008 at 10:29 AM, Benjamin Peterson > <[EMAIL PROTECTED]> wrote: >> >> Benjamin Peterson <[

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Wed, Aug 20, 2008 at 2:53 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > > On Wed, Aug 20, 2008 at 4:51 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: >> >> Brett Cannon <[EMAIL PR

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: On Wed, Aug 20, 2008 at 5:03 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Well, the bulk of the code needs to live in 'warnings' for it to exist > if the 'test' package is missing. So any differences need to come from > the test.support

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Wed, Aug 20, 2008 at 3:05 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > Alternatively, you could just have another copy of catch_warning in > test_warnings with the extra argu

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: All right. You win! :) ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list m

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-21 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- priority: critical -> release blocker ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Pyt

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-22 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: I think I can clean up the code by shifting WarningMessage over to a subclass of namedtuple and moving WarningsRecorder over to a subclass of list. ___ Python tracker <[EMAIL PROTECTED]>

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-22 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: The patch does a couple of things. It moves test.test_support.catch_warning() to warnings.catch_warnings() and leaves a stub behind. WarningsRecorder becomes a subclass of list to make it easier to work with. The uses of catch_warnings() in the

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-22 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: See my comments on Rietveld. http://codereview.appspot.com/3255 ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-22 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11227/move_catch_warnings.diff ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-22 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: New patch is up with a minor change from Benjamin's review. My explicit comments on the suggestions are on Rietveld. ___ Python tracker <[EMAIL PROTECTED]> _

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-08-27 Thread Mark Hammond
Mark Hammond <[EMAIL PROTECTED]> added the comment: I stumbled across this when mimetools import of test failed due to finding a local test package, not the python test package, so I too will be happy to see this fixed. -- nosy: +mhammond ___ Python t

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-09-01 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I think the patch can now go in. -- keywords: -needs review ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-09-01 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- assignee: -> brett.cannon ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-li

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-09-01 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Applied in the trunk under r66135. Working on merging in 3.0. -- status: open -> pending ___ Python tracker <[EMAIL PROTECTED]>

[issue3602] Move test.test_suport.catch_warning() to the 'warnings' module

2008-09-01 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: r66139 has the 3.0 work. Had to rip out an outdated DeprecationWarning. Also moved over to keyword-only arguments as stated in the 2.6 docs. -- resolution: -> accepted status: pending -> closed ___