support parallel grammar preprocessing (#1996)

Co-authored-by: Lianmin Zheng <lianminzheng@gmail.com>
This commit is contained in:
DarkSharpness
2024-11-13 01:45:28 +09:00
committed by GitHub
parent eff468dd5a
commit 125b1199c5
9 changed files with 159 additions and 141 deletions

View File

@@ -100,8 +100,8 @@ class TestJSONConstrained(unittest.TestCase):
except (TypeError, json.decoder.JSONDecodeError):
print("JSONDecodeError", text)
raise
assert isinstance(js_obj["name"], str)
assert isinstance(js_obj["population"], int)
assert isinstance(js_obj["name"], str), f"{js_obj=}"
assert isinstance(js_obj["population"], int), f"{js_obj=}"
def test_mix_json_and_other(self):
json_schemas = [None, None, self.json_schema, self.json_schema] * 10