diff --git a/appveyor.yml b/appveyor.yml index d3a9bf0..ceb7974 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,10 +38,16 @@ build: off test_script: - "echo 'About to run tests...'" - # Set timeout for pytest (e.g., 300 seconds)--timeout=1000 - #- "pytest Tests/ || exit 0" - - "pytest Tests/ || exit /b 0" - - #- "pytest Tests/" + # Run pytest and capture its exit code + - "pytest Tests/ || SET PYTEST_ERRORLEVEL=%errorlevel%" + + # Check if pytest failed (assuming non-zero exit code indicates failure) + - "if %PYTEST_ERRORLEVEL% neq 0 (" + - " echo 'Pytest failed. Terminating python process.'" + - " taskkill /IM python.exe /F" + - ") else (" + - " echo 'Pytest succeeded.'" + - ")" + - "echo 'Finished running tests.'" - "if %errorlevel% neq 0 exit /b %errorlevel%"