docstr: Test early stopping with ftol
docstr_tok: ["Test","early","stopping","with","ftol"]
code: def test_ftol_effect(self, optimizer):
      """Test early stopping with ftol"""
      optm, params = optimizer
      params["ftol"] = 0.01
      opt = optm(**params)
      opt.optimize(objective_function, iters=iterations, **kwargs)
      assert len(opt.cost_history) <= iterations
  
file_path: pyswarms/tests/optimizers/test_tolerance.py
imports: import pytest
  import random
  import numpy
  from pyswarms.backend.topology import Star
  from pyswarms.single import GlobalBestPSO, LocalBestPSO, GeneralOptimizerPSO
label_desc: Use image node_id 3 for calling the TestToleranceOptions obj's underlying member method code with example usage: obj.test_ftol_effect(optimizer) without return types