'Test against full runpytest() output.'

def test_full_output_truncated(self, monkeypatch, testdir):

    line_count = 7
    line_len = 100
    expected_truncated_lines = 2
    testdir.makepyfile(("\n                                                def    test_many_lines():\n                                                                a    =    list([str(i)[0]    *    %d    for    i    in    range(%d)])\n                                                                b    =    a[::2]\n                                                                a    =    '\\n'.join(map(str,    a))\n                                                                b    =    '\\n'.join(map(str,    b))\n                                                                assert    a    ==    b\n                                " % (line_len, line_count)))
    monkeypatch.delenv('CI', raising=False)
    result = testdir.runpytest()
    result.stdout.fnmatch_lines(['*-    1*', '*-    3*', '*-    5*', ('*truncated    (%d    lines    hidden)*use*-vv*' % expected_truncated_lines)])
    result = testdir.runpytest('-vv')
    result.stdout.fnmatch_lines(['*    6*'])
    monkeypatch.setenv('CI', '1')
    result = testdir.runpytest()
    result.stdout.fnmatch_lines(['*    6*'])
