- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconftest.py
More file actions
Latest commit
15 lines (12 loc) · 487 Bytes
/
Copy pathconftest.py
File metadata and controls
15 lines (12 loc) · 487 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""pytest configuration — add project src to Python path."""
importsite
importsys
frompathlibimportPath
# Add user site-packages (contains pathspec, rich, click for Python 3.12)
user_site=site.getusersitepackages()
ifuser_siteanduser_sitenotinsys.path:
sys.path.insert(0, user_site)
# Add src directory to Python path so tests can import deadcode package
src_dir=Path(__file__).parent/"src"
ifstr(src_dir) notinsys.path:
sys.path.insert(0, str(src_dir))