def _lintCheck(self, expectSuccess, source):
        document = minidom.parseString(source)
        filename = self.mktemp()
        checker = getDefaultChecker()

        output = StringIO()
        patch = self.patch(sys, 'stdout', output)
        try:
            try:
                checker.check(document, filename)
            finally:
                patch.restore()
        except ProcessingFailure, e:
            if expectSuccess:
                raise
        else:
            if not expectSuccess:
                self.fail(
                    "Expected checker to fail, but it did not.  "
                    "Output was: %r" % (output.getvalue(),))

        return output.getvalue()
Lint the given document source and return the output.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/lore/test/test_lint.py/DefaultTagCheckerTests._lintCheck