Getting random results from same program
I am making a post call using python requests library. My program works fine sometimes as I expected but gives error "UnboundLocalError: local variable 'response' referenced before assignment" some other times.
def test_fun():
try:
response = requests.get(f"{Base_URI}/Calls.json", auth=(AccSid, AccToken))
except Exception as err:
print(f'Other error occurred: {err}')
assert response.status_code == 200
"UnboundLocalError: local variable 'response' referenced before assignment"