conftest.py 528 B

1234567891011121314151617181920
  1. from __future__ import annotations
  2. import pytest
  3. from agency_swarm import Agency, Agent
  4. @pytest.fixture
  5. def agency_factory():
  6. """Factory function to create a test agency."""
  7. def create_agency(load_threads_callback=None, save_threads_callback=None):
  8. agent = Agent(name="TestAgent", instructions="Base instructions")
  9. return Agency(
  10. agent,
  11. load_threads_callback=load_threads_callback,
  12. save_threads_callback=save_threads_callback,
  13. )
  14. return create_agency