def assert_amnesty(self, input_code, errors, expected):
input_code = textwrap.dedent(input_code)<EOL>expected = textwrap.dedent(expected)<EOL>errors_by_line = defaultdict(list)<EOL>for error in errors:<EOL><INDENT>errors_by_line[error.linenum].append(error)<EOL><DEDENT>output_lines = itertools.chain.from_iterable(<EOL>fix_pylint(line, errors_by_line[lineno])<EOL>for lineno, line<EOL>in enumerate(StringIO(input_code), start=<NUM_LIT:1>)<EOL>)<EOL>self.assertEqual(expected.split(u'<STR_LIT:\n>'), "<STR_LIT>".join(output_lines).split(u'<STR_LIT:\n>'))<EOL>
Assert that fix_pylint produces ``expected`` when fed ``input_code`` and the
list of errors ``errors``.

Arguments:
    input_code: A string of python code. Will be textwrap.dedented.
    errors: A list of PylintErrors
    expected: A string of python code. Will be textwrap.dedented.