class_docstr: #351
class_docstr_tok: ["#","351"]
code: def test_idfn_fixture(self, pytester: Pytester) -> None:
      pytester.makepyfile(
          """
              import pytest
  
              def idfn(param):
                  if param == 0:
                      return 'spam'
                  elif param == 1:
                      return 'ham'
                  else:
                      return None
  
              @pytest.fixture(params=[0, 1], ids=idfn)
              def a(request):
                  return request.param
  
              @pytest.fixture(params=[1, 2], ids=idfn)
              def b(request):
                  return request.param
  
              def test_params(a, b):
                  pass
          """
      )
      res = pytester.runpytest("--collect-only")
      res.stdout.fnmatch_lines(["*spam-2*", "*ham-2*"])
  
imports: import pytest
  from _pytest._code import getfslineno
  from _pytest.fixtures import getfixturemarker
  from _pytest.pytester import Pytester
  from _pytest.python import Function
label_desc: Use image node_id 2 for calling the TestParameterize obj's underlying member method code with example usage: obj.test_idfn_fixture(pytester) without return types