Re: [Python-Dev] test.support.check_warnings

2014-01-12 Thread Ethan Furman
On 01/12/2014 04:24 AM, Antoine Pitrou wrote: On Sat, 11 Jan 2014 23:10:43 -0800 Ethan Furman wrote: On 01/11/2014 05:37 PM, Brett Cannon wrote: You're assuming the context manager is doing something magical to verify that all calls in the block raise the expected exception. What you want to

Re: [Python-Dev] test.support.check_warnings

2014-01-12 Thread Antoine Pitrou
On Sat, 11 Jan 2014 23:10:43 -0800 Ethan Furman wrote: > On 01/11/2014 05:37 PM, Brett Cannon wrote: > > > > You're assuming the context manager is doing something magical to verify > > that all calls in the block raise the expected > > exception. What you want to do is execute it in a loop:: > >

Re: [Python-Dev] test.support.check_warnings

2014-01-11 Thread Ethan Furman
On 01/11/2014 05:37 PM, Brett Cannon wrote: You're assuming the context manager is doing something magical to verify that all calls in the block raise the expected exception. What you want to do is execute it in a loop:: for test in (...): with support.check_warnings(("automatic int co

Re: [Python-Dev] test.support.check_warnings

2014-01-11 Thread Brett Cannon
On Sat, Jan 11, 2014 at 3:45 PM, Ethan Furman wrote: > The docs say this [1]: > == > test.support.check_warnings(*filters, quiet=True) > > A convenience wrapper for warnings.catch_warnings() that makes it > easier to test that a warning