'Assert that L{printBriefTraceback} produces and prints a brief
traceback.
The brief traceback consists of a header::
Traceback: <type \'exceptions.ZeroDivisionError\'>: float division
The body with the stacktrace::
/twisted/trial/_synctest.py:1180:_run
/twisted/python/util.py:1076:runWithWarningsSuppressed
And the footer::
--- <exception caught here> ---
/twisted/test/test_failure.py:39:getDivisionFailure
@param captureVars: Enables L{Failure.captureVars}.
@type captureVars: C{bool}'

def assertBriefTraceback(self, captureVars=False):

    if captureVars:
        exampleLocalVar = 'abcde'
        exampleLocalVar
    f = getDivisionFailure()
    out = NativeStringIO()
    f.printBriefTraceback(out)
    tb = out.getvalue()
    stack = ''
    for (method, filename, lineno, localVars, globalVars) in f.frames:
        stack += ('%s:%s:%s\n' % (filename, lineno, method))
    zde = repr(ZeroDivisionError)
    self.assertTracebackFormat(tb, ('Traceback:    %s:    ' % (zde,)), ('%s\n%s' % (failure.EXCEPTION_CAUGHT_HERE, stack)))
    if captureVars:
        self.assertIsNone(re.search('exampleLocalVar.*abcde', tb))
