summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-12-19 01:02:54 (GMT)
committerGitHub <noreply@github.com>2017-12-19 01:02:54 (GMT)
commit9818142b1bd20243733a953fb8aa2c7be314c47c (patch)
tree625350fae6c199ae5442118eaf36db480fe00046 /Lib/test/test_asyncore.py
parent6efcb6d3d5911aaf699f9df3bb3bc26e94f38e6d (diff)
downloadcpython-9818142b1bd20243733a953fb8aa2c7be314c47c.zip
cpython-9818142b1bd20243733a953fb8aa2c7be314c47c.tar.gz
cpython-9818142b1bd20243733a953fb8aa2c7be314c47c.tar.bz2
bpo-32331: Fix socket.type when SOCK_NONBLOCK is available (#4877)
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index ee0c3b3..694ddff 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -726,14 +726,10 @@ class BaseTestAPI:
def test_create_socket(self):
s = asyncore.dispatcher()
s.create_socket(self.family)
+ self.assertEqual(s.socket.type, socket.SOCK_STREAM)
self.assertEqual(s.socket.family, self.family)
- SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
- sock_type = socket.SOCK_STREAM | SOCK_NONBLOCK
- if hasattr(socket, 'SOCK_CLOEXEC'):
- self.assertIn(s.socket.type,
- (sock_type | socket.SOCK_CLOEXEC, sock_type))
- else:
- self.assertEqual(s.socket.type, sock_type)
+ self.assertEqual(s.socket.gettimeout(), 0)
+ self.assertFalse(s.socket.get_inheritable())
def test_bind(self):
if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX: