This commit is contained in:
beabigegg
2025-09-02 13:11:48 +08:00
parent a60d965317
commit b11a8272c4
76 changed files with 15321 additions and 200 deletions

36
run_tests.bat Normal file
View File

@@ -0,0 +1,36 @@
@echo off
REM 測試執行腳本
echo ========================================
echo 執行 PANJIT Document Translator 測試
echo ========================================
REM 啟動虛擬環境
if exist "venv\Scripts\activate.bat" (
call venv\Scripts\activate.bat
) else (
echo 錯誤: 找不到虛擬環境,請先執行 start_dev.bat
pause
exit /b 1
)
REM 安裝測試依賴
echo 安裝測試依賴...
pip install pytest pytest-cov pytest-mock
REM 執行測試
echo 執行單元測試...
python -m pytest tests/ -v --tb=short
REM 生成測試覆蓋率報告
echo.
echo 生成測試覆蓋率報告...
python -m pytest tests/ --cov=app --cov-report=html --cov-report=term-missing
echo.
echo ========================================
echo 測試完成!
echo 覆蓋率報告已生成到: htmlcov/index.html
echo ========================================
pause