def test_parametrize_ids_exception(self, pytester: Pytester) -> None:
        """
        :param pytester: the instance of Pytester class, a temporary
        test directory.
        """
        pytester.makepyfile(
            """
                import pytest

                def ids(arg):
                    raise Exception("bad ids")

                @pytest.mark.parametrize("arg", ["a", "b"], ids=ids)
                def test_foo(arg):
                    pass
            """
        )
        result = pytester.runpytest()
        result.stdout.fnmatch_lines(
            [
                "*Exception: bad ids",
                "*test_foo: error raised while trying to determine id of parameter 'arg' at position 0",
            ]
        )

        :param pytester: the instance of Pytester class, a temporary
        test directory.
        
testing/python/metafunc.py