def test_conftest(self, pytester: Pytester) -> None:
        """Directory containing conftest modules are not put in sys.path as a side-effect of
        importing them."""
        tests_dir = pytester.path.joinpath("tests")
        pytester.makepyfile(
            **{
                "tests/conftest.py": "",
                "tests/test_foo.py": f"""
                import sys
                def test_check():
                    assert r"{tests_dir}" not in sys.path
                """,
            }
        )
        result = pytester.runpytest("-v", "--import-mode=importlib")
        result.stdout.fnmatch_lines(["* 1 passed in *"])
Directory containing conftest modules are not put in sys.path as a side-effect of
        importing them.
testing/test_collection.py