43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
|
|
# ===================AIPASS====================
|
|
# META DATA HEADER
|
|
# Name: tests/conftest.py
|
|
# Date: 2025-11-08
|
|
# Version: 1.0.0
|
|
# Category: cortex/tests
|
|
#
|
|
# CHANGELOG (Max 5 entries):
|
|
# - v1.0.0 (2025-11-08): Initial implementation - Shared pytest fixtures
|
|
#
|
|
# CODE STANDARDS:
|
|
# - Error handling: Use error handler system (apps/handlers/error/)
|
|
# =============================================
|
|
|
|
"""Shared pytest fixtures for cortex tests"""
|
|
import pytest
|
|
import shutil
|
|
import tempfile
|
|
from pathlib import Path
|
|
from typing import Generator
|
|
|
|
|
|
@pytest.fixture
|
|
def temp_test_dir() -> Generator[Path, None, None]:
|
|
"""Creates temporary directory for testing, cleans up after"""
|
|
test_dir = Path(tempfile.mkdtemp())
|
|
yield test_dir
|
|
if test_dir.exists():
|
|
shutil.rmtree(test_dir)
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_test_data() -> dict:
|
|
"""Provides sample test data
|
|
|
|
Customize this fixture for your module's needs
|
|
"""
|
|
return {
|
|
"test_key": "test_value",
|
|
"sample_data": "example"
|
|
}
|