I think this socket object is leaked and the garbage collect is left to clean it up.  Please clean up resources like this explicitly (`TestCase.addCleanup` helps).