def test_continue_on_failure(self, testdir):
    testdir.maketxtfile(test_something="\n            >>> i = 5\n            >>> def foo():\n            ...     raise ValueError('error1')\n            >>> foo()\n            >>> i\n            >>> i + 2\n            7\n            >>> i + 1\n        ")
    result = testdir.runpytest('--doctest-modules', '--doctest-continue-on-failure')
    result.assert_outcomes(passed=0, failed=1)
    result.stdout.fnmatch_lines(['*4: UnexpectedException*', '*5: DocTestFailure*', '*8: DocTestFailure*'])
def test_continue_on_failure(self, testdir):
    testdir.maketxtfile(test_something="\n            >>> i = 5\n            >>> def foo():\n            ...     raise ValueError('error1')\n            >>> foo()\n            >>> i\n            >>> i + 2\n            7\n            >>> i + 1\n        ")
    result = testdir.runpytest('--doctest-modules', '--doctest-continue-on-failure')
    result.assert_outcomes(passed=0, failed=1)
    result.stdout.fnmatch_lines(['*4: UnexpectedException*', '*5: DocTestFailure*', '*8: DocTestFailure*'])