'Test that we show some context before the actual line of a failing
doctest.'

def test_docstring_context_around_error(self, testdir):

    testdir.makepyfile('\n                                                def    foo():\n                                                                """\n                                                                text-line-1\n                                                                text-line-2\n                                                                text-line-3\n                                                                text-line-4\n                                                                text-line-5\n                                                                text-line-6\n                                                                text-line-7\n                                                                text-line-8\n                                                                text-line-9\n                                                                text-line-10\n                                                                text-line-11\n                                                                >>>    1    +    1\n                                                                3\n\n                                                                text-line-after\n                                                                """\n                                ')
    result = testdir.runpytest('--doctest-modules')
    result.stdout.fnmatch_lines(['*docstring_context_around_error*', '005*text-line-3', '006*text-line-4', '013*text-line-11', '014*>>>    1    +    1', 'Expected:', '                3', 'Got:', '                2'])
    assert ('text-line-2' not in result.stdout.str())
    assert ('text-line-after' not in result.stdout.str())
