Fixed all pytest errors, enhanced book parser with context management and resource cleanup, update tests for proper parser closure

This commit is contained in:
Deniz Şafak
2026-01-10 00:09:04 +03:00
parent bd30939d27
commit 950eb317f0
6 changed files with 123 additions and 77 deletions
+7 -4
View File
@@ -28,10 +28,13 @@ def _soundfile_write_stub(
pass
if "soundfile" not in sys.modules: # pragma: no cover - import guard
stub = ModuleType("soundfile")
stub.write = _soundfile_write_stub # type: ignore[attr-defined]
sys.modules["soundfile"] = stub
try:
import soundfile
except ImportError:
if "soundfile" not in sys.modules: # pragma: no cover - import guard
stub = ModuleType("soundfile")
stub.write = _soundfile_write_stub # type: ignore[attr-defined]
sys.modules["soundfile"] = stub
def _static_ffmpeg_add_paths_stub(*_args, **_kwargs) -> None: # pragma: no cover - stub