def test_model_post_init_correct_mro():
    """https://github.com/pydantic/pydantic/issues/7293"""
    calls = []

    class A(BaseModel):
        a: int = 1

    class B(BaseModel):
        b: int = 1

        def model_post_init(self, context: Any, /) -> None:
            calls.append(f'{self.__class__.__name__}.model_post_init')

    class C(A, B):
        _private: bool = True

    C()

    assert calls == ['C.model_post_init']
https://github.com/pydantic/pydantic/issues/7293
tests/test_main.py