From ebd1695f2b2aa53d105b4598bc2a5c7dcd81a0bf Mon Sep 17 00:00:00 2001 From: Kowshik BV Date: Tue, 27 Aug 2024 16:29:36 +0530 Subject: [PATCH] Linter changes Signed-off-by: Kowshik BV --- .../tests/test_psycopg2_integration.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py index 4ee871e538..c6d0dac089 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py @@ -262,23 +262,23 @@ def test_sqlcommenter_enabled(self, event_mocked): self.assertEqual(kwargs["enable_commenter"], True) @mock.patch("opentelemetry.instrumentation.dbapi.wrap_connect") - def test_sqlcommenter_enabled_no_op_tracer(self, event_mocked): - tracer_provider = trace.NoOpTracerProvider() - trace.set_tracer_provider(tracer_provider) + def test_sqlcommenter_disabled(self, event_mocked): cnx = psycopg2.connect(database="test") - Psycopg2Instrumentor().instrument(tracer_provider=tracer_provider, enable_commenter=True) + Psycopg2Instrumentor().instrument() query = "SELECT * FROM test" cursor = cnx.cursor() cursor.execute(query) kwargs = event_mocked.call_args[1] - self.assertEqual(kwargs["enable_commenter"], True) + self.assertEqual(kwargs["enable_commenter"], False) @mock.patch("opentelemetry.instrumentation.dbapi.wrap_connect") - def test_sqlcommenter_disabled(self, event_mocked): + def test_sqlcommenter_enabled_no_op_tracer(self, event_mocked): cnx = psycopg2.connect(database="test") - Psycopg2Instrumentor().instrument() + Psycopg2Instrumentor().instrument( + tracer_provider=trace.NoOpTracerProvider(), enable_commenter=True + ) query = "SELECT * FROM test" cursor = cnx.cursor() cursor.execute(query) kwargs = event_mocked.call_args[1] - self.assertEqual(kwargs["enable_commenter"], False) + self.assertEqual(kwargs["enable_commenter"], True)