def METHOD_NAME(self):
    file_path = os.path.join(FIXTURES_DIR, "invalid.txt")
    output_file_success = io.StringIO()
    output_file_error = io.StringIO()
    f_diskstats = None
    try:
        f_diskstats = open(file_path, "r")
        parse_and_print_metrics(f_diskstats, output_file_success, output_file_error)
    finally:
        if f_diskstats:
            f_diskstats.close()
    output_success = output_file_success.getvalue()
    output_error = output_file_error.getvalue().strip()
    self.assertEqual(
        output_error, "Cannot parse /proc/diskstats line:  3    0   hda 446216"
    )
    self.assertEqual(output_success, "")