summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_urllib2.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 632524c..9d9260a 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")