Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-27584: Fixes for V3
Added checking for fcntl and thread modules.
  • Loading branch information
caavery committed Sep 5, 2017
commit c3027e5dd7355127d8a18189f2f392b39a52cf92
10 changes: 6 additions & 4 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@
_socket = None

def get_cid():
import struct
import fcntl

if fcntl is None:
return None
if not os.path.exists("/dev/vsock"):
return None
try:
Expand Down Expand Up @@ -413,6 +412,8 @@ def clientTearDown(self):
self.cli = None
ThreadableTest.clientTearDown(self)

@unittest.skipIf(fcntl is None, "need fcntl")
@unittest.skipUnless(thread, 'Threading required for this test.')
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
'VSOCK sockets required for this test.')
@unittest.skipUnless(get_cid() != 2,
Expand Down Expand Up @@ -1933,7 +1934,8 @@ def _testCongestion(self):
r, w, x = select.select([self.serv], [], [], 3.0)
self.assertIn(self.serv, r)



@unittest.skipIf(fcntl is None, "need fcntl")
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
'VSOCK sockets required for this test.')
class BasicVSOCKTest(unittest.TestCase):
Expand Down