@mock.patch('requests.adapters.HTTPAdapter.send', side_effect=requests.RequestException(response=mocked_response))
def test_requests_exception_with_response(self, *_, **__):
    with self.assertRaises(requests.RequestException):
        self.perform_request(self.URL)
    span = self.assert_span()
    self.assertEqual(span.attributes, {SpanAttributes.HTTP_METHOD: 'GET', SpanAttributes.HTTP_URL: self.URL, SpanAttributes.HTTP_STATUS_CODE: 500})
    self.assertEqual(span.status.status_code, StatusCode.ERROR)
@mock.patch('requests.adapters.HTTPAdapter.send', side_effect=requests.RequestException(response=mocked_response))
def test_requests_exception_with_response(self, *_, **__):
    with self.assertRaises(requests.RequestException):
        self.perform_request(self.URL)
    span = self.assert_span()
    self.assertEqual(span.attributes, {SpanAttributes.HTTP_METHOD: 'GET', SpanAttributes.HTTP_URL: self.URL, SpanAttributes.HTTP_STATUS_CODE: 500})
    self.assertEqual(span.status.status_code, StatusCode.ERROR)