test_fileno(): Skip this test on Windows.
This commit is contained in:
parent
047c54bb24
commit
813cec9a62
|
@ -84,8 +84,12 @@ class urlopenNetworkTests(unittest.TestCase):
|
|||
self.assertEqual(gotten_url, URL)
|
||||
|
||||
def test_fileno(self):
|
||||
if (sys.platform in ('win32',) or
|
||||
not hasattr(os, 'fdopen')):
|
||||
# On Windows, socket handles are not file descriptors; this
|
||||
# test can't pass on Windows.
|
||||
return
|
||||
# Make sure fd returned by fileno is valid.
|
||||
if hasattr(os, 'fdopen'):
|
||||
open_url = urllib.urlopen("http://www.python.org/")
|
||||
fd = open_url.fileno()
|
||||
FILE = os.fdopen(fd)
|
||||
|
|
Loading…
Reference in New Issue