19 lines
510 B
Python
19 lines
510 B
Python
# tests/conftest.py
|
|
import os
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from logwatcher.logging import setup_logging
|
|
|
|
# Forcer un dossier temporaire pour les tests
|
|
os.environ["PYTEST_DEBUG_TEMPROOT"] = str(Path("output/test").absolute())
|
|
|
|
@pytest.fixture
|
|
def tmp_log_file(tmp_path):
|
|
return tmp_path / "logwatcher_test.log"
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def tmp_setup_logging(tmp_log_file):
|
|
"""Redirige les logs vers un dossier temporaire pendant les tests."""
|
|
setup_logging(file_path=tmp_log_file) |