def Write(self, filename, file=None):
    """Writes the test output. Should be called after vim has shut down.

    Args:
      filename: Used in the header.
      file: Alt file to redirect output to. Output will only be redirected
          if it was going to be output in the first place.
    Raises:
      NoTestRunning: if called too soon.
    """
    if not self._opened:
      raise NoTestRunning
    self.ExecutedUpTo(len(self._lines) - 1)
    for (line, args, kwargs) in self._queue:
      self.Print(line, *args, file=file, **kwargs)
dataset/ETHPy150Open google/vroom/vroom/output.py/ActionLogger.Write/original