import re


def invert_single_assertion(file_string,match,replacement,assertion):
  """Invert an assertion by replacing the old one, using the regex match"""

  repl_string = assertion + '(' + match.group(1) + replacement + match.group(3) + ')'
  result = file_string[:match.start()] + repl_string + file_string[match.end():]
  return re.sub('@expect verified', '@expect error', result)