def test_custom_directory_example(self, pytester: Pytester) -> None:
        """Verify the example from the customdirectory.rst doc."""
        pytester.copy_example("customdirectory")

        reprec = pytester.inline_run()

        reprec.assertoutcome(passed=2, failed=0)
        calls = reprec.getcalls("pytest_collect_directory")
        assert len(calls) == 2
        assert calls[0].path == pytester.path
        assert isinstance(calls[0].parent, pytest.Session)
        assert calls[1].path == pytester.path / "tests"
        assert isinstance(calls[1].parent, pytest.Dir)
Verify the example from the customdirectory.rst doc.
testing/test_collection.py