def setup_conftest_and_foo(self, pytester: Pytester) -> None:
        """Setup a tests folder to be used to test if modules in that folder can be imported
        due to side-effects of --import-mode or not."""
        pytester.makepyfile(
            **{
                "tests/conftest.py": "",
                "tests/foo.py": """
                    def foo(): return 42
                """,
                "tests/test_foo.py": """
                    def test_check():
                        from foo import foo
                        assert foo() == 42
                """,
            }
        )
Setup a tests folder to be used to test if modules in that folder can be imported
        due to side-effects of --import-mode or not.
testing/test_collection.py