From: Serhiy Storchaka Date: Sat, 8 Feb 2014 12:51:10 +0000 (+0200) Subject: Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref tests. X-Git-Tag: v3.4.0rc1~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3e1207191dcb84a58706a5101177f36c09c5681;p=python Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref tests. --- d3e1207191dcb84a58706a5101177f36c09c5681 diff --cc Lib/test/test_urllib2.py index dbd1c60ec2,3559b1b789..b32b4090e8 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@@ -603,9 -594,30 +603,9 @@@ class OpenerDirectorTests(unittest.Test self.assertIsInstance(args[0], Request) # response from opener.open is None, because there's no # handler that defines http_open to handle it - self.assertTrue(args[1] is None or - isinstance(args[1], MockResponse)) + if args[1] is not None: + self.assertIsInstance(args[1], MockResponse) - def test_method_deprecations(self): - req = Request("http://www.example.com") - - with self.assertWarns(DeprecationWarning): - req.add_data("data") - with self.assertWarns(DeprecationWarning): - req.get_data() - with self.assertWarns(DeprecationWarning): - req.has_data() - with self.assertWarns(DeprecationWarning): - req.get_host() - with self.assertWarns(DeprecationWarning): - req.get_selector() - with self.assertWarns(DeprecationWarning): - req.is_unverifiable() - with self.assertWarns(DeprecationWarning): - req.get_origin_req_host() - with self.assertWarns(DeprecationWarning): - req.get_type() - - def sanepathname2url(path): try: path.encode("utf-8")