conftest.py 860 B

123456789101112131415161718192021222324252627282930
  1. """
  2. Pytest configuration for tests.
  3. Configures anyio to only use asyncio backend (not trio).
  4. Checks that the skill_seekers package is installed before running tests.
  5. """
  6. import sys
  7. import pytest
  8. def pytest_configure(config):
  9. """Check if package is installed before running tests."""
  10. try:
  11. import skill_seekers
  12. except ModuleNotFoundError:
  13. print("\n" + "=" * 70)
  14. print("ERROR: skill_seekers package not installed")
  15. print("=" * 70)
  16. print("\nPlease install the package in editable mode first:")
  17. print(" pip install -e .")
  18. print("\nOr activate your virtual environment if you already installed it.")
  19. print("=" * 70 + "\n")
  20. sys.exit(1)
  21. @pytest.fixture(scope="session")
  22. def anyio_backend():
  23. """Override anyio backend to only use asyncio (not trio)."""
  24. return "asyncio"