code: def test_on_bad_lines_callable_python_or_pyarrow(self, all_parsers):
      # GH 5686
      # GH 54643
      sio = StringIO("a,b\n1,2")
      bad_lines_func = lambda x: x
      parser = all_parsers
      if all_parsers.engine not in ["python", "pyarrow"]:
          msg = (
              "on_bad_line can only be a callable "
              "function if engine='python' or 'pyarrow'"
          )
          with pytest.raises(ValueError, match=msg):
              parser.read_csv(sio, on_bad_lines=bad_lines_func)
      else:
          parser.read_csv(sio, on_bad_lines=bad_lines_func)
  
file_path: pandas/pandas/tests/io/parser/test_unsupported.py
imports: from io import StringIO
  import os
  from pathlib import Path
  import pytest
  from pandas.errors import ParserError
  import pandas._testing
  from pandas.io.parsers import read_csv
  import pandas.io.parsers.readers
label_desc: Use image node_id 6 for calling the TestUnsupportedFeatures obj's underlying member method code with example usage: obj.test_on_bad_lines_callable_python_or_pyarrow(all_parsers) without return types