From c4127224fd0dfc524f2c5ed77f0d30b3bbe7b095 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Tue, 17 Mar 2026 15:45:06 +0100 Subject: [PATCH] simplify test, ensure it fails on master --- tests/test_jsonable_encoder.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/test_jsonable_encoder.py b/tests/test_jsonable_encoder.py index 01a7b6f35e..dfbf478c4d 100644 --- a/tests/test_jsonable_encoder.py +++ b/tests/test_jsonable_encoder.py @@ -321,16 +321,11 @@ def test_encode_pydantic_undefined(): pytest.param("pydantic_extra_types.color"), ], ) -def test_color_encoder(module_path): +def test_encode_color(module_path): try: Color = __import__(module_path, fromlist=["Color"]).Color except ImportError: pytest.skip(f"{module_path} not available") - class ModelWithColors(BaseModel): - color: Color - model_config = {"arbitrary_types_allowed": True} - - obj = ModelWithColors(color=Color("blue")) - encoded = jsonable_encoder(obj) - assert encoded == {"color": "blue"} + data = {"color": Color("blue")} + assert jsonable_encoder(data) == {"color": "blue"}