def test_fscollector_from_parent(pytester: Pytester, request: FixtureRequest) -> None:
    """Ensure File.from_parent can forward custom arguments to the constructor.

    Context: https://github.com/pytest-dev/pytest-cpp/pull/47
    """

    class MyCollector(pytest.File):
        def __init__(self, *k, x, **kw):
            super().__init__(*k, **kw)
            self.x = x

        def collect(self):
            raise NotImplementedError()

    collector = MyCollector.from_parent(
        parent=request.session, path=pytester.path / "foo", x=10
    )
    assert collector.x == 10
Ensure File.from_parent can forward custom arguments to the constructor.

    Context: https://github.com/pytest-dev/pytest-cpp/pull/47
    
testing/test_collection.py