feat: Ollama und Modell vor dem Start prüfen, kurze Meldung statt Traceback
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
82489ee83c
commit
6aa4887f22
1 changed files with 105 additions and 11 deletions
|
|
@ -1,4 +1,4 @@
|
|||
"""Shared fixtures: yt-dlp is always replaced by fakes (no network)."""
|
||||
"""Shared fixtures: yt-dlp and Ollama are always replaced by fakes (no network)."""
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
|
|
@ -7,6 +7,17 @@ from pathlib import Path
|
|||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def ollama_available(request, monkeypatch):
|
||||
"""Skip the Ollama server check; tests marked real_ollama_check test it."""
|
||||
if "real_ollama_check" in request.keywords:
|
||||
return
|
||||
import glossar_vorschlag
|
||||
import rede_korrigieren
|
||||
for module in (rede_korrigieren, glossar_vorschlag):
|
||||
monkeypatch.setattr(module, "check_ollama", lambda model: None)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fake_yt_dlp():
|
||||
"""Factory for a subprocess.run stand-in.
|
||||
|
|
|
|||
Loading…
Reference in a new issue