Skip to content

Commit ee42082

Browse files
authored
Update OpenAI testing infra to match bedrock (#939)
1 parent 2834663 commit ee42082

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
File renamed without changes.

tests/mlmodel_openai/conftest.py

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

15+
import json
1516
import os
16-
import pprint
1717

1818
import pytest
19+
from _mock_external_openai_server import (
20+
MockExternalOpenAIServer,
21+
extract_shortened_prompt,
22+
)
1923
from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611
2024
event_loop as loop,
2125
)
2226
from testing_support.fixtures import ( # noqa: F401, pylint: disable=W0611
2327
collector_agent_registration_fixture,
2428
collector_available_fixture,
2529
)
26-
from testing_support.mock_external_openai_server import (
27-
MockExternalOpenAIServer,
28-
extract_shortened_prompt,
29-
)
3030

3131
from newrelic.common.object_wrapper import wrap_function_wrapper
3232

@@ -78,7 +78,7 @@ def openai_server():
7878

7979
# Write responses to audit log
8080
with open(OPENAI_AUDIT_LOG_FILE, "w") as audit_log_fp:
81-
pprint.pprint(OPENAI_AUDIT_LOG_CONTENTS, stream=audit_log_fp)
81+
json.dump(OPENAI_AUDIT_LOG_CONTENTS, fp=audit_log_fp, indent=4)
8282

8383

8484
# Intercept outgoing requests and log to file for mocking

0 commit comments

Comments
 (0)