Skip to content

Commit b6177e2

Browse files
committed
[fix] add type annotation in test script
1 parent 5c8209d commit b6177e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/python/serve/server/test_server_structural_tag.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import json
1212
import os
1313
import re
14-
from typing import Dict, List, Optional
14+
from typing import Dict, List, Optional, Any
1515

1616
import pytest
1717
import requests
@@ -136,7 +136,11 @@ def check_openai_stream_response(
136136

137137

138138
def check_format(name_beg: str, name_end: str, beg_tag: str, schema: str):
139-
schema = json.loads(schema)
139+
try:
140+
schema: dict[str, Any] = json.loads(schema)
141+
except json.JSONDecodeError as e:
142+
print(f"Invalid JSON format: {e}")
143+
assert False
140144
assert "hash_code" in schema
141145
hash_code = schema["hash_code"]
142146
assert hash_code in CHECK_INFO

0 commit comments

Comments
 (0)