We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d863f5c commit d9cffceCopy full SHA for d9cffce
tests/contrib/openai_agents/test_openai.py
@@ -72,25 +72,16 @@
72
from tests.helpers import new_worker
73
from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name
74
75
-response_index: int = 0
76
-
77
78
class StaticTestModel(TestModel):
79
__test__ = False
80
responses: list[ModelResponse] = []
81
82
- def response(self):
83
- global response_index
84
- response = self.responses[response_index]
85
- response_index += 1
86
- return response
87
88
def __init__(
89
self,
90
) -> None:
91
92
- response_index = 0
93
- super().__init__(self.response)
+ self._responses = iter(self.responses)
+ super().__init__(lambda: next(self._responses))
94
95
96
class TestHelloModel(StaticTestModel):
0 commit comments