def test_default_factory_works_on_subclasses() -> None:
    """https://github.com/pydantic/pydantic/issues/2424"""

    @dataclasses.dataclass
    class Base:
        x: str

    @dataclasses.dataclass
    class Thing(Base):
        y: str = dataclasses.field(default_factory=str)

    assert Thing(x='hi').y == ''

    @pydantic.dataclasses.dataclass
    class ValidatedThing(Base):
        y: str = dataclasses.field(default_factory=str)

    assert Thing(x='hi').y == ''
    assert ValidatedThing(x='hi').y == ''
https://github.com/pydantic/pydantic/issues/2424
tests/test_dataclasses.py