def test_unlisteningString(self):
        """
        The string representation of a L{TuntapPort} instance includes the
        tunnel type and interface and the protocol associated with the port.
        """
        if _PY3:
            self.assertRegex(str(self.port),
                             fullyQualifiedName(self.protocol.__class__))

            expected = " not listening on %s/%s>" % (
                self._tunnelTypeOnly(self.helper.TUNNEL_TYPE).name,
                self.name)
            self.assertTrue(str(self.port).find(expected) != -1)
        else:
            expected = "<%s not listening on %s/%s>" % (
                fullyQualifiedName(self.protocol.__class__),
                self._tunnelTypeOnly(self.helper.TUNNEL_TYPE).name, self.name)
            self.assertEqual(expected, str(self.port))

        The string representation of a L{TuntapPort} instance includes the
        tunnel type and interface and the protocol associated with the port.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/pair/test/test_tuntap.py