import pytest import sys from pathlib import Path from datetime import datetime, timedelta sys.path.append(str(Path(__file__).parent.parent)) @pytest.fixture def temp_data_dir(tmp_path): """Create a temporary data directory with test files.""" data_dir = tmp_path / "data" data_dir.mkdir() return data_dir def test_autoclean_script_exists(): """Test that the autoclean script exists and is valid Python.""" script_path = Path(__file__).parent.parent / "autoclean_debug.py" assert script_path.exists() # Verify it's valid Python with open(script_path, 'r', encoding='utf-8') as f: code = f.read() try: compile(code, 'autoclean_debug.py', 'exec') except SyntaxError as e: pytest.fail(f"Syntax error in autoclean_debug.py: {e}")