conftest.py 653 B

1234567891011121314151617181920
  1. import json
  2. import sys
  3. from pathlib import Path
  4. from pytest import fixture
  5. # this is a hack and should be removed when we have a better solution
  6. _this_dir = Path(__file__).resolve().parent
  7. root_dir = _this_dir.parent
  8. package_dir = root_dir / "sweagent"
  9. sys.path.insert(0, str(root_dir))
  10. sys.path.insert(1, str(package_dir))
  11. print("Adjusted path: ", sys.path)
  12. @fixture
  13. def test_trajectory() -> Path:
  14. traj_dir = _this_dir / "test_data/trajectories/gpt4__klieret__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/klieret__swe-agent-test-repo-i1.traj"
  15. assert traj_dir.exists()
  16. return json.loads(traj_dir.read_text())