]> granicus.if.org Git - python/commitdiff
#17471 - Improve urllib2 test coverage. Patch contributed by Daniel Wozniak
authorSenthil Kumaran <senthil@uthcode.com>
Tue, 19 Mar 2013 20:43:42 +0000 (13:43 -0700)
committerSenthil Kumaran <senthil@uthcode.com>
Tue, 19 Mar 2013 20:43:42 +0000 (13:43 -0700)
Lib/test/test_urllib2.py

index 5eab30af76553cd00a1e7dffa4a21ba681a2feac..a9776ac8571d7f5b0cd02a8c48f6b63decb508cc 100644 (file)
@@ -47,6 +47,9 @@ class TrivialTests(unittest.TestCase):
         for string, list in tests:
             self.assertEqual(urllib.request.parse_http_list(string), list)
 
+    def test_URLError_reasonstr(self):
+        err = urllib.error.URLError('reason')
+        self.assertIn(err.reason, str(err))
 
 def test_request_headers_dict():
     """