def terminate(self) -> typing.Optional[str]:
        """Terminate the process and return its stdout/stderr in a string."""
        if self._proc is not None:
            self._proc.terminate()
            self._proc.wait()
            self._proc = None

        # Read the stdout file and close it
        stdout = None
        if self._stdout_file is not None:
            self._stdout_file.seek(0)
            stdout = self._stdout_file.read()
            self._stdout_file.close()
            self._stdout_file = None

        return stdout
Terminate the process and return its stdout/stderr in a string.
cookiecutter/{{ cookiecutter.package_name }}/e2e/e2e_utils.py