def test_access_formatter_exc_colour():
    f = AccessFormatter()
    f.stream_is_tty = True
    try:
        raise RuntimeError('testing')
    except RuntimeError:
        stack = f.formatException(sys.exc_info())
        assert stack.startswith('\x1b[38;5;26mTraceback')
def test_access_formatter_exc():
    f = AccessFormatter()
    try:
        raise RuntimeError('testing')
    except RuntimeError:
        stack = f.formatException(sys.exc_info())
        assert stack.startswith('Traceback (most recent call last):\n')
        assert stack.endswith('RuntimeError: testing\n')