diff options
| author | Senthil Kumaran <senthil@uthcode.com> | 2012-04-11 23:05:49 +0800 |
|---|---|---|
| committer | Senthil Kumaran <senthil@uthcode.com> | 2012-04-11 23:05:49 +0800 |
| commit | 08bd4aaaf982f833251ff5107252b1314cf0a415 (patch) | |
| tree | 8e43ffddd2b21471e5814961e92daac8757f356b | |
| parent | 9fe92d1de52fcb63527b2cffa5dbfbc2ae719508 (diff) | |
| download | cpython-git-08bd4aaaf982f833251ff5107252b1314cf0a415.tar.gz | |
use assertWarns instead of check_warnings - Issue14341
| -rw-r--r-- | Lib/test/test_urllib2.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 632524c4e0..9d9260ab3d 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -618,21 +618,23 @@ class OpenerDirectorTests(unittest.TestCase): def test_method_deprecations(self): req = Request("http://www.example.com") - with support.check_warnings(('', DeprecationWarning)): + + with self.assertWarns(DeprecationWarning) as cm: req.add_data("data") - with support.check_warnings(('', DeprecationWarning)): + with self.assertWarns(DeprecationWarning) as cm: req.has_data() - with support.check_warnings(('', DeprecationWarning)): + with self.assertWarns(DeprecationWarning) as cm: req.get_data() - with support.check_warnings(('', DeprecationWarning)): + with self.assertWarns(DeprecationWarning) as cm: req.get_host() - with support.check_warnings(('', DeprecationWarning)): + with self.assertWarns(DeprecationWarning) as cm: req.get_selector() - with support.check_warnings(('', DeprecationWarning)): + with self.assertWarns(DeprecationWarning) as cm: req.is_unverifiable() - with support.check_warnings(('', DeprecationWarning)): + with self.assertWarns(DeprecationWarning) as cm: req.get_origin_req_host() + def sanepathname2url(path): try: path.encode("utf-8") |
