[issue9754] assertWarns and assertWarnsRegexp

2010-11-01 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue9754] assertWarns and assertWarnsRegexp

2010-09-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r84563! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue9754] assertWarns and assertWarnsRegexp

2010-09-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch so that the tests pass with -Werror. Do you think this should be committed before the next alpha? -- Added file: http://bugs.python.org/file18756/assertwarns2.patch ___ Python tracker

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Why not accepting a tuple of warnings? It already does (and there's a test!). > That doesn't make sense for assertWarnsRegexp of course. True. -- ___ Python tracker __

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Michael Foord
Michael Foord added the comment: Why not accepting a tuple of warnings? That doesn't make sense for assertWarnsRegexp of course. -- ___ Python tracker ___ __

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Patch looks good. However tests do not pass with -Werror (while test_warnings > and others pass). > > > Is there a way to catch multiple warnings on a single logical line? I thought we could beef up the API with additional arguments. That would be at the e

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Florent Xicluna
Florent Xicluna added the comment: Patch looks good. However tests do not pass with -Werror (while test_warnings and others pass). Is there a way to catch multiple warnings on a single logical line? (With assertRaises we don't have such use case) -- stage: needs patch -> patch review

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Michael Foord
Michael Foord added the comment: (Note that in general I am against extending the TestCase API with more asserts given how wide it is and how much it has expanded in recent versions. I've written warning checking code enough times for third party projects that I think this is worth it though.

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file18727/assertwarns.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: There was some dead code in the patch. -- Added file: http://bugs.python.org/file18728/assertwarns.patch ___ Python tracker ___

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. The approach is different from support.check_warnings(), and tries to mimic assertRaises* instead. -- keywords: +patch Added file: http://bugs.python.org/file18727/assertwarns.patch ___ Python track

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: +1 from me as well. -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailin

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Florent Xicluna
Florent Xicluna added the comment: > unittest should provide assertWarns and assertWarnsRegexp +1 (the internal helpers in test.support could be refactored) > The __warningregistry__ stuff looks horrible. +1 (and it does not behave exactly the same in all Python versions) -- nosy: +f

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: The __warningregistry__ stuff looks horrible. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Michael Foord
Michael Foord added the comment: +1 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou
New submission from Antoine Pitrou : Similar to assertRaises and assertRaisesRegexp, unittest should provide assertWarns and assertWarnsRegexp, to check that a given callable (or piece of code) triggers a particular warning. Currently, you have to do that manually using a mixture of warnings.