def test_subclassing_both_item_and_collector_deprecated(
    request, tmp_path: Path
) -> None:
    """
    Verifies we warn on diamond inheritance as well as correctly managing legacy
    inheritance constructors with missing args as found in plugins.
    """
    # We do not expect any warnings messages to issued during class definition.
    with warnings.catch_warnings():
        warnings.simplefilter("error")

        class SoWrong(nodes.Item, nodes.File):
            def __init__(self, fspath, parent):
                """Legacy ctor with legacy call # don't wana see"""
                super().__init__(fspath, parent)

            def collect(self):
                raise NotImplementedError()

            def runtest(self):
                raise NotImplementedError()

    with pytest.warns(PytestWarning) as rec:
        SoWrong.from_parent(
            request.session, fspath=legacy_path(tmp_path / "broken.txt")
        )
    messages = [str(x.message) for x in rec]
    assert any(
        re.search(".*SoWrong.* not using a cooperative constructor.*", x)
        for x in messages
    )
    assert any(
        re.search("(?m)SoWrong .* should not be a collector", x) for x in messages
    )

    Verifies we warn on diamond inheritance as well as correctly managing legacy
    inheritance constructors with missing args as found in plugins.
    
testing/test_nodes.py