-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
23 lines (18 loc) · 750 Bytes
/
conftest.py
File metadata and controls
23 lines (18 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Root conftest.py
# This file ensures that pytest only collects tests from our tests directory
# and ignores any tests in temporary directories or installed packages
import os
import sys
# Add the 'src' directory to the path so imports work correctly
# This ensures that the in-development code is used, not the installed version
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "src")))
def pytest_ignore_collect(collection_path, config):
"""
Configure pytest to ignore certain paths when collecting tests.
Returns:
bool: True if the path should be ignored, False otherwise.
"""
# Skip the temp directory
if "temp/" in str(collection_path):
return True
return False