def test_invalid_url(self):
    url = 'http://[::1/nope'
    with self.assertRaises(ValueError):
        requests.post(url)
    span = self.assert_span()
    self.assertEqual(span.name, 'HTTP POST')
    self.assertEqual(span.attributes, {SpanAttributes.HTTP_METHOD: 'POST', SpanAttributes.HTTP_URL: url})
    self.assertEqual(span.status.status_code, StatusCode.ERROR)
def test_invalid_url(self):
    url = 'http://[::1/nope'
    with self.assertRaises(ValueError):
        requests.post(url)
    span = self.assert_span()
    self.assertEqual(span.name, 'HTTP POST')
    self.assertEqual(span.attributes, {SpanAttributes.HTTP_METHOD: 'POST', SpanAttributes.HTTP_URL: url})
    self.assertEqual(span.status.status_code, StatusCode.ERROR)