I want to send requests to a deployed app on a cloud run with python, but inside the test file, I don't want to hardcode the endpoint; how can I get the URL of the deployed app with python script inside the test file so that I can send requests to that URL?
You can use gcloud to fetch the url of the service like this

gcloud run services describe  SERVICE_NAME
--format="value(status.url)"
Retrive endpoint url of deployed app from google cloud run with Python