Commit 53f8ba52 authored by Victor Stinner's avatar Victor Stinner

test_urllibnet: set timeout on test_fileno()

Use the default timeout of 30 seconds to avoid blocking forever.
parent 9db2ae72
...@@ -104,7 +104,7 @@ class urlopenNetworkTests(unittest.TestCase): ...@@ -104,7 +104,7 @@ class urlopenNetworkTests(unittest.TestCase):
@unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows') @unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows')
def test_fileno(self): def test_fileno(self):
# Make sure fd returned by fileno is valid. # Make sure fd returned by fileno is valid.
with self.urlopen("http://www.google.com/", timeout=None) as open_url: with self.urlopen("http://www.google.com/") as open_url:
fd = open_url.fileno() fd = open_url.fileno()
with os.fdopen(fd, 'rb') as f: with os.fdopen(fd, 'rb') as f:
self.assertTrue(f.read(), "reading from file created using fd " self.assertTrue(f.read(), "reading from file created using fd "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment