def cleanUp(self):
        """
        Clean-up for tests to wait for the port to stop listening.
        """
        if self._cleanerUpper is None:
            return self.port.stopListening()
        return self._cleanerUpper

        Clean-up for tests to wait for the port to stop listening.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_tcp.py