Skip to content

Commit 1a01b79

Browse files
committed
Misc test cleanup. Now that scripts are invoked solely through pytest via tox, remove main functions and hash bang lines.
1 parent e654b89 commit 1a01b79

File tree

4 files changed

+0
-46
lines changed

4 files changed

+0
-46
lines changed

instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_async_nonstreaming.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
# reimplement this in terms of "nonstreaming_base.py".
1818

1919
import asyncio
20-
import logging
21-
import unittest
2220

2321
from ..common.base import TestCase
2422

@@ -76,12 +74,3 @@ def test_async_generate_content_not_broken_by_instrumentation(self):
7674
model="gemini-2.0-flash", contents="Does this work?"
7775
)
7876
self.assertEqual(response.text, "Yep, it works!")
79-
80-
81-
def main():
82-
logging.basicConfig(level=logging.DEBUG)
83-
unittest.main()
84-
85-
86-
if __name__ == "__main__":
87-
main()

instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_async_streaming.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!./run_with_env.sh
2-
31
# Copyright The OpenTelemetry Authors
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,8 +17,6 @@
1917
# covering the cases of one response and multiple streaming responses.
2018

2119
import asyncio
22-
import logging
23-
import unittest
2420

2521
from ..common.base import TestCase
2622

@@ -87,12 +83,3 @@ def test_async_generate_content_not_broken_by_instrumentation(self):
8783
)
8884
self.assertEqual(len(responses), 1)
8985
self.assertEqual(responses[0].text, "Yep, it works!")
90-
91-
92-
def main():
93-
logging.basicConfig(level=logging.DEBUG)
94-
unittest.main()
95-
96-
97-
if __name__ == "__main__":
98-
main()

instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_sync_nonstreaming.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import logging
16-
import unittest
1715

1816
from .nonstreaming_base import NonStreamingTestCase
1917

@@ -25,12 +23,3 @@ def generate_content(self, *args, **kwargs):
2523
@property
2624
def expected_function_name(self):
2725
return "google.genai.Models.generate_content"
28-
29-
30-
def main():
31-
logging.basicConfig(level=logging.DEBUG)
32-
unittest.main()
33-
34-
35-
if __name__ == "__main__":
36-
main()

instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_sync_streaming.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
# two different tests here that inherit from "streaming_base" and "nonstreaming_base",
1717
# covering the cases of one response and multiple streaming responses.
1818

19-
import logging
20-
import unittest
2119

2220
from ..common.base import TestCase
2321

@@ -79,12 +77,3 @@ def test_async_generate_content_not_broken_by_instrumentation(self):
7977
)
8078
self.assertEqual(len(responses), 1)
8179
self.assertEqual(responses[0].text, "Yep, it works!")
82-
83-
84-
def main():
85-
logging.basicConfig(level=logging.DEBUG)
86-
unittest.main()
87-
88-
89-
if __name__ == "__main__":
90-
main()

0 commit comments

Comments
 (0)