def test_paramset_empty_no_idfunc(
    pytester: Pytester, monkeypatch: pytest.MonkeyPatch
) -> None:
    """An empty parameter set should not call the user provided id function (#13031)."""
    p1 = pytester.makepyfile(
        """
        import pytest

        def idfunc(value):
            raise ValueError()
        @pytest.mark.parametrize("param", [], ids=idfunc)
        def test(param):
            pass
        """
    )
    result = pytester.runpytest(p1, "-v", "-rs")
    result.stdout.fnmatch_lines(
        [
            "* collected 1 item",
            "test_paramset_empty_no_idfunc* SKIPPED *",
            "SKIPPED [1] test_paramset_empty_no_idfunc.py:5: got empty parameter set for (param)",
            "*= 1 skipped in *",
        ]
    )
An empty parameter set should not call the user provided id function (#13031).
testing/test_mark.py