def createTestSocket(test, addressFamily, socketType):
 skt = socket.socket(addressFamily, socketType)
 test.addCleanup(skt.close)
 return skt

def createTestSocket ( test , addressFamily , socketType ) : skt = socket . socket ( addressFamily , socketType ) test . addCleanup ( skt . close ) return skt
create a socket for the duration of the given test .