def run_subprocess(command, cwd=None):
        """
        Helper function to run a subprocess command and return its output and exit code.
        """
        result = subprocess.run(
            command,
            shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True,
            cwd=cwd,
        )
        if result.returncode != 0:
            raise RuntimeError(f"Command failed: {command}\n{result.stderr}")
        return result.stdout.strip()

        Helper function to run a subprocess command and return its output and exit code.
        
tests/test_authentication.py