diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index ccd5419b709e..3377cffcba21 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -64,6 +64,9 @@ def test_parse_http_list(self): 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(): """