[Python-Dev] cpython: use assertWarns instead of check_warnings - Issue14341 (original) (raw)
Georg Brandl g.brandl at gmx.net
Wed Apr 11 21:33:30 CEST 2012
- Previous message: [Python-Dev] Experimenting with STM on CPython
- Next message: [Python-Dev] cpython: use assertWarns instead of check_warnings - Issue14341
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 11.04.2012 17:06, senthil.kumaran wrote:
http://hg.python.org/cpython/rev/751c7b81f6ee changeset: 76241:751c7b81f6ee parent: 76232:8a47d2322df0 user: Senthil Kumaran<senthil at uthcode.com> date: Wed Apr 11 23:05:49 2012 +0800 summary: use assertWarns instead of checkwarnings - Issue14341
files: Lib/test/testurllib2.py | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Lib/test/testurllib2.py b/Lib/test/testurllib2.py --- a/Lib/test/testurllib2.py +++ b/Lib/test/testurllib2.py @@ -618,21 +618,23 @@ def testmethoddeprecations(self): req = Request("http://www.example.com") - with support.checkwarnings(('', DeprecationWarning)): + + with self.assertWarns(DeprecationWarning) as cm: req.adddata("data")
There's no need for adding the "as cm" if you don't need the cm object.
Georg
- Previous message: [Python-Dev] Experimenting with STM on CPython
- Next message: [Python-Dev] cpython: use assertWarns instead of check_warnings - Issue14341
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]