Skip to content

Commit 3bc0a82

Browse files
committed
Remove unittest.main
1 parent d7d0478 commit 3bc0a82

2 files changed

Lines changed: 1 addition & 18 deletions

File tree

ext/opentelemetry-ext-flask/tests/test_automatic.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@
1313
# limitations under the License.
1414

1515
from logging import NOTSET, WARNING, disable
16-
from unittest import main
17-
18-
# This is used instead of from flask import Flask, request because if not then
19-
# FlaskInstrumentor().instrument() would need to be called before importing
20-
# Flask. This is just an intrinsic limitation due the fact that we are testing
21-
# the instrumentor in a way that mimics how it would be called with the
22-
# opentelemetry-auto-instrumentation command. This does not mean that the
23-
# instrumentor should be used in this way in end user applications. For those
24-
# cases, FlaskInstrumentor.instrument(app=app) should be used.
16+
2517
import flask
2618
from werkzeug.test import Client
2719
from werkzeug.wrappers import BaseResponse
@@ -92,7 +84,3 @@ def hello_endpoint(helloid):
9284
self.assertEqual(span_list[0].name, "hello_endpoint")
9385
self.assertEqual(span_list[0].kind, trace_api.SpanKind.SERVER)
9486
self.assertEqual(span_list[0].attributes, expected_attrs)
95-
96-
97-
if __name__ == "__main__":
98-
main()

ext/opentelemetry-ext-flask/tests/test_programmatic.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
from logging import NOTSET, WARNING, disable
16-
from unittest import main
1716

1817
from flask import Flask
1918
from werkzeug.test import Client
@@ -75,7 +74,3 @@ def test_uninstrument(self):
7574
self.assertEqual(span_list[0].name, "hello_endpoint")
7675
self.assertEqual(span_list[0].kind, trace_api.SpanKind.SERVER)
7776
self.assertEqual(span_list[0].attributes, expected_attrs)
78-
79-
80-
if __name__ == "__main__":
81-
main()

0 commit comments

Comments
 (0)