Commit f35dca8d authored by Jason Madden's avatar Jason Madden

Close leaking files, and python 3.5 does support socketpair on Win32

parent 1517b80f
......@@ -10,8 +10,10 @@ class TestSocketpair(unittest.TestCase):
x, y = socket.socketpair()
x.sendall(msg)
x.close()
read = y.makefile('rb').read()
with y.makefile('rb') as f:
read = f.read()
self.assertEqual(msg, read)
y.close()
def test_fromfd(self):
msg = b'hello world'
......@@ -23,8 +25,10 @@ class TestSocketpair(unittest.TestCase):
xx.sendall(msg)
xx.close()
read = yy.makefile('rb').read()
with yy.makefile('rb') as f:
read = f.read()
self.assertEqual(msg, read)
yy.close()
if __name__ == '__main__':
......
......@@ -12,6 +12,7 @@ COVERAGE = os.getenv("COVERAGE_PROCESS_START")
PYPY = hasattr(sys, 'pypy_version_info')
PY3 = sys.version_info[0] >= 3
PY26 = sys.version_info[0] == 2 and sys.version_info[1] == 6
PY35 = sys.version_info[0] >= 3 and sys.version_info[1] >= 5
PYGTE279 = (
sys.version_info[0] == 2
and sys.version_info[1] >= 7
......@@ -58,7 +59,6 @@ if sys.platform == 'win32':
'test__core_fork.py',
'test__issues461_471.py',
'test__execmodules.py',
'test__socketpair.py',
'test__makefile_ref.py',
'FLAKY test__greenletset.py',
# The various timeout tests are flaky for unknown reasons
......@@ -67,6 +67,14 @@ if sys.platform == 'win32':
'FLAKY test_hub_join_timeout.py',
]
if not PY35:
# Py35 added socket.socketpair, all other releases
# are missing it
FAILING_TESTS += [
'test__socketpair.py',
]
if struct.calcsize('P') * 8 == 64:
# could be a problem of appveyor - not sure
# ======================================================================
......
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