forked from yusufkaraaslan/Skill_Seekers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
31 lines (24 loc) · 891 Bytes
/
conftest.py
File metadata and controls
31 lines (24 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Pytest configuration for tests.
Configures anyio to only use asyncio backend (not trio).
Checks that the skill_seekers package is installed before running tests.
"""
import sys
import pytest
def pytest_configure(config): # noqa: ARG001
"""Check if package is installed before running tests."""
try:
import skill_seekers # noqa: F401
except ModuleNotFoundError:
print("\n" + "=" * 70)
print("ERROR: skill_seekers package not installed")
print("=" * 70)
print("\nPlease install the package in editable mode first:")
print(" pip install -e .")
print("\nOr activate your virtual environment if you already installed it.")
print("=" * 70 + "\n")
sys.exit(1)
@pytest.fixture(scope="session")
def anyio_backend():
"""Override anyio backend to only use asyncio (not trio)."""
return "asyncio"