class_docstr: Test suite for compute_pbest()
class_docstr_tok: ["Test","suite","for","compute_pbest","(",")"]
docstr: Test if method raises AttributeError with wrong swarm
docstr_tok: ["Test","if","method","raises","AttributeError","with","wrong","swarm"]
code: def test_input_swarm(self, swarm):
      """Test if method raises AttributeError with wrong swarm"""
      with pytest.raises(AttributeError):
          P.compute_pbest(swarm)
  
file_path: pyswarms/tests/backend/test_operators.py
imports: import numpy
  import pytest
  import pyswarms.backend
  from pyswarms.backend.handlers import BoundaryHandler, VelocityHandler
label_desc: Use image node_id 2 for calling the TestComputePbest obj's underlying member method code with example usage: obj.test_input_swarm(swarm) without return types