mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-08-02 11:31:52 +08:00
use f-strings instead of format (#693)
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
This commit is contained in:
@ -192,8 +192,7 @@ def _wrap_perform_request(
|
||||
for member in _ATTRIBUTES_FROM_RESULT:
|
||||
if member in rv:
|
||||
span.set_attribute(
|
||||
"elasticsearch.{0}".format(member),
|
||||
str(rv[member]),
|
||||
f"elasticsearch.{member}", str(rv[member]),
|
||||
)
|
||||
|
||||
if callable(response_hook):
|
||||
|
@ -169,7 +169,7 @@ class TestElasticsearchIntegration(TestBase):
|
||||
self.assertFalse(span.status.is_ok)
|
||||
self.assertEqual(span.status.status_code, code)
|
||||
self.assertEqual(
|
||||
span.status.description, "{}: {}".format(type(exc).__name__, exc)
|
||||
span.status.description, f"{type(exc).__name__}: {exc}"
|
||||
)
|
||||
|
||||
def test_parent(self, request_mock):
|
||||
|
Reference in New Issue
Block a user