Skip to content

Commit d9c050e

Browse files
authored
Create conftest.py
1 parent 4d07c55 commit d9c050e

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

test/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""Test configuration file."""
2+
import os
3+
import sys
4+
import pytest
5+
6+
# Add project root to Python path for test discovery
7+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
8+
9+
# Optional: Disable terminal warnings for cleaner output
10+
def pytest_terminal_summary(terminalreporter, exitstatus, config):
11+
reports = terminalreporter.getreports("")
12+
for report in reports:
13+
if report.when == "call":
14+
terminalreporter.stats.pop("warnings", None)
15+
16+
# Fixture for temporary files (optional but useful)
17+
@pytest.fixture
18+
def temp_file():
19+
with tempfile.NamedTemporaryFile(delete=False) as tmp:
20+
yield tmp.name
21+
try:
22+
os.unlink(tmp.name)
23+
except:
24+
pass

0 commit comments

Comments
 (0)