def test_defaultdict_unknown_default_factory() -> None:
    """
    https://github.com/pydantic/pydantic/issues/4687
    """
    with pytest.raises(
        PydanticSchemaGenerationError,
        match=r'Unable to infer a default factory for keys of type collections.defaultdict\[int, int\]',
    ):

        class Model(BaseModel):
            d: defaultdict[int, defaultdict[int, int]]

    https://github.com/pydantic/pydantic/issues/4687
    
tests/test_types.py