def test_better_reporting_on_conftest_load_failure(
        self, pytester: Pytester
    ) -> None:
        """Show a user-friendly traceback on conftest import failures (#486, #3332)"""
        pytester.makepyfile("")
        conftest = pytester.makeconftest(
            """
            def foo():
                import qwerty
            foo()
        """
        )
        result = pytester.runpytest("--help")
        result.stdout.fnmatch_lines(
            """
            *--version*
            *warning*conftest.py*
        """
        )
        result = pytester.runpytest()
        assert result.stdout.lines == []
        assert result.stderr.lines == [
            f"ImportError while loading conftest '{conftest}'.",
            "conftest.py:3: in <module>",
            "    foo()",
            "conftest.py:2: in foo",
            "    import qwerty",
            "E   ModuleNotFoundError: No module named 'qwerty'",
        ]
Show a user-friendly traceback on conftest import failures (#486, #3332)
testing/acceptance_test.py