75 lines
2.3 KiB
Python
Executable File
75 lines
2.3 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Script de prueba para verificar que la aplicación arranca correctamente
|
|
sin errores relacionados con el widget notes.
|
|
"""
|
|
|
|
import sys
|
|
import subprocess
|
|
import time
|
|
|
|
def test_startup():
|
|
"""Prueba que la aplicación arranca sin errores críticos"""
|
|
print("🧪 Probando inicio de aplicación...")
|
|
print("=" * 60)
|
|
|
|
# Ejecutar la aplicación por 3 segundos y capturar salida
|
|
try:
|
|
process = subprocess.Popen(
|
|
['python3', 'app.py'],
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE,
|
|
text=True
|
|
)
|
|
|
|
# Esperar 3 segundos para ver si hay errores iniciales
|
|
time.sleep(3)
|
|
|
|
# Intentar terminar el proceso
|
|
process.terminate()
|
|
|
|
# Esperar a que termine y capturar salida
|
|
try:
|
|
stdout, stderr = process.communicate(timeout=2)
|
|
except subprocess.TimeoutExpired:
|
|
process.kill()
|
|
stdout, stderr = process.communicate()
|
|
|
|
print("\n📤 Salida estándar:")
|
|
print("-" * 60)
|
|
if stdout:
|
|
print(stdout)
|
|
else:
|
|
print("(Sin salida)")
|
|
|
|
print("\n⚠️ Errores/Advertencias:")
|
|
print("-" * 60)
|
|
if stderr:
|
|
# Filtrar errores críticos
|
|
lines = stderr.split('\n')
|
|
critical_errors = [line for line in lines if 'AttributeError' in line or 'Traceback' in line or 'Error' in line]
|
|
|
|
if critical_errors:
|
|
print("❌ ERRORES CRÍTICOS ENCONTRADOS:")
|
|
for line in critical_errors:
|
|
print(f" {line}")
|
|
return False
|
|
else:
|
|
print("(Solo advertencias menores, no errores críticos)")
|
|
else:
|
|
print("(Sin errores)")
|
|
|
|
print("\n" + "=" * 60)
|
|
print("✅ La aplicación arrancó correctamente")
|
|
print("✅ No se detectaron errores de AttributeError con 'notes'")
|
|
print("✅ Puedes ejecutar: python3 app.py")
|
|
return True
|
|
|
|
except Exception as e:
|
|
print(f"\n❌ Error durante la prueba: {e}")
|
|
return False
|
|
|
|
if __name__ == '__main__':
|
|
success = test_startup()
|
|
sys.exit(0 if success else 1)
|