def test_directory_ignored_if_none(self, pytester: Pytester) -> None:
        """If the (entire) hook returns None, it's OK, the directory is ignored."""
        pytester.makeconftest(
            """
            import pytest

            @pytest.hookimpl(wrapper=True)
            def pytest_collect_directory():
                yield
                return None
            """,
        )
        pytester.makepyfile(
            **{
                "tests/test_it.py": """
                    import pytest

                    def test_it(): pass
                """,
            },
        )
        reprec = pytester.inline_run()
        reprec.assertoutcome(passed=0, failed=0)
If the (entire) hook returns None, it's OK, the directory is ignored.
testing/test_collection.py