def assertCorrectException(self, errno, message, result, expectedClass):
        """
        The given result of L{error.getConnectError} has the given attributes
        (C{osError} and C{args}), and is an instance of the given class.
        """

        # Want exact class match, not inherited classes, so no isinstance():
        self.assertEqual(result.__class__, expectedClass)
        self.assertEqual(result.osError, errno)
        self.assertEqual(result.args, (message,))

        The given result of L{error.getConnectError} has the given attributes
        (C{osError} and C{args}), and is an instance of the given class.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_error.py