Skip to content

Commit 85101f9

Browse files
committed
lint
1 parent 25a738c commit 85101f9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
)
4141
from opentelemetry.instrumentation.dependencies import (
4242
DependencyConflict,
43-
DependencyConflictError,
4443
)
4544
from opentelemetry.sdk.metrics.export import (
4645
HistogramDataPoint,
@@ -1116,7 +1115,7 @@ def test_instruments_with_old_fastapi_installed(
11161115
# dependency_conflict
11171116
# )
11181117
# TODO: return conflict instead of raising
1119-
mock_dep.return_value = DependencyConflictError(dependency_conflict)
1118+
mock_dep.return_value = dependency_conflict
11201119
_load_instrumentors(mock_distro)
11211120
mock_distro.load_instrumentor.assert_not_called()
11221121
self.assertEqual(
@@ -1151,7 +1150,7 @@ def test_instruments_without_fastapi_installed(
11511150
# mock_distro.load_instrumentor.side_effect = DependencyConflictError(
11521151
# dependency_conflict
11531152
# )
1154-
mock_dep.return_value = DependencyConflictError(dependency_conflict)
1153+
mock_dep.return_value = dependency_conflict
11551154
_load_instrumentors(mock_distro)
11561155
mock_distro.load_instrumentor.assert_not_called()
11571156
self.assertEqual(

opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _load_instrumentors(distro):
104104
entry_point_dist = entry_point_finder.dist_for(entry_point)
105105
conflict = get_dist_dependency_conflicts(entry_point_dist)
106106
if conflict:
107-
print("conflict found %s: %s" % (entry_point.name, conflict))
107+
# print("conflict found %s: %s" % (entry_point.name, conflict))
108108
_logger.debug(
109109
"Skipping instrumentation %s: %s",
110110
entry_point.name,
@@ -115,7 +115,7 @@ def _load_instrumentors(distro):
115115
# tell instrumentation to not run dep checks again as we already did it above
116116
distro.load_instrumentor(entry_point, skip_dep_check=True)
117117
_logger.debug("Instrumented %s", entry_point.name)
118-
print("Instrumented %s" % entry_point.name)
118+
# print("Instrumented %s" % entry_point.name)
119119
# except DependencyConflictError as exc:
120120
# print(
121121
# "Skipping instrumentation %s: %s" % (
@@ -147,15 +147,15 @@ def _load_instrumentors(distro):
147147
# environment regarding python version, libc, etc... In this case it's better
148148
# to skip the single instrumentation rather than failing to load everything
149149
# so treat differently ImportError than the rest of exceptions
150-
print(
151-
"Skipping instrumentation %s: ImportError" % entry_point.name
152-
)
150+
# print(
151+
# "Skipping instrumentation %s: ImportError" % entry_point.name
152+
# )
153153
_logger.exception(
154154
"Importing of %s failed, skipping it", entry_point.name
155155
)
156156
continue
157157
except Exception as exc: # pylint: disable=broad-except
158-
print("Skipping instrumentation %s: %s" % (entry_point.name, exc))
158+
# print("Skipping instrumentation %s: %s" % (entry_point.name, exc))
159159
_logger.exception("Instrumenting of %s failed", entry_point.name)
160160
raise exc
161161

0 commit comments

Comments
 (0)