class_docstr: Test suite for compute_velocity()
class_docstr_tok: ["Test","suite","for","compute_velocity","(",")"]
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, vh_strat):
      """Test if method raises AttributeError with wrong swarm"""
      vh = VelocityHandler(strategy=vh_strat)
      with pytest.raises(AttributeError):
          P.compute_velocity(swarm, clamp=(0, 1), vh=vh)
  
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 TestComputeVelocity obj's underlying member method code with example usage: obj.test_input_swarm(swarm, vh_strat) without return types