def test_dataclass_slots_validate_assignment():
    """https://github.com/pydantic/pydantic/issues/11768"""

    m = DataclassSlotsValidateAssignment(1)
    m_pickle = pickle.loads(pickle.dumps(m))
    assert m_pickle.a == 1
    with pytest.raises(ValidationError):
        m.a = 'not_an_int'
https://github.com/pydantic/pydantic/issues/11768
tests/test_dataclasses.py