def test_collectignore_via_conftest(pytester: Pytester) -> None:
    """collect_ignore in parent conftest skips importing child (issue #4592)."""
    tests = pytester.mkpydir("tests")
    tests.joinpath("conftest.py").write_text(
        "collect_ignore = ['ignore_me']", encoding="utf-8"
    )

    ignore_me = tests.joinpath("ignore_me")
    ignore_me.mkdir()
    ignore_me.joinpath("__init__.py").touch()
    ignore_me.joinpath("conftest.py").write_text(
        "assert 0, 'should_not_be_called'", encoding="utf-8"
    )

    result = pytester.runpytest()
    assert result.ret == ExitCode.NO_TESTS_COLLECTED
collect_ignore in parent conftest skips importing child (issue #4592).
testing/test_collection.py