Remove catching OSError in ftphandler test. Only URLError is raised in urllib.request module. (#918)

This commit is contained in:
Senthil Kumaran 2017-03-30 22:43:05 -07:00 committed by GitHub
parent 33db068dac
commit ed3dd1c02a
1 changed files with 1 additions and 3 deletions

View File

@ -830,7 +830,6 @@ class HandlerTests(unittest.TestCase):
for url, ftp in [ for url, ftp in [
("file://ftp.example.com//foo.txt", False), ("file://ftp.example.com//foo.txt", False),
("file://ftp.example.com///foo.txt", False), ("file://ftp.example.com///foo.txt", False),
# XXXX bug: fails with OSError, should be URLError
("file://ftp.example.com/foo.txt", False), ("file://ftp.example.com/foo.txt", False),
("file://somehost//foo/something.txt", False), ("file://somehost//foo/something.txt", False),
("file://localhost//foo/something.txt", False), ("file://localhost//foo/something.txt", False),
@ -839,7 +838,7 @@ class HandlerTests(unittest.TestCase):
try: try:
h.file_open(req) h.file_open(req)
# XXXX remove OSError when bug fixed # XXXX remove OSError when bug fixed
except (urllib.error.URLError, OSError): except urllib.error.URLError:
self.assertFalse(ftp) self.assertFalse(ftp)
else: else:
self.assertIs(o.req, req) self.assertIs(o.req, req)
@ -1689,7 +1688,6 @@ class HandlerTests(unittest.TestCase):
self.assertTrue(conn.fakesock.closed, "Connection not closed") self.assertTrue(conn.fakesock.closed, "Connection not closed")
class MiscTests(unittest.TestCase): class MiscTests(unittest.TestCase):
def opener_has_handler(self, opener, handler_class): def opener_has_handler(self, opener, handler_class):