replace inefficient use of to_jsonable_python (#545)

This commit is contained in:
Samuel Colvin 2025-04-26 11:41:19 -07:00 • committed by GitHub
commit 697b6e8e05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 17 deletions

View file

@ -100,7 +100,7 @@ class TestFunctionResource:
fn=lambda: MyModel(name="test"),
)
content = await resource.read()
assert content == '{"name": "test"}'
assert content == '{\n "name": "test"\n}'
@pytest.mark.anyio
async def test_custom_type_conversion(self):

View file

@ -185,4 +185,4 @@ class TestResourceTemplate:
assert isinstance(resource, FunctionResource)
content = await resource.read()
assert content == "hello"
assert content == '"hello"'