From c6a6d0fe17cc25cca9de32c7835d8b0a0900214d Mon Sep 17 00:00:00 2001 From: Claudio Satriano Date: Fri, 24 May 2024 12:05:32 +0200 Subject: [PATCH] Script to run tests on Windows using pytest. This script allows for a temporary test failure by repeating the test 5 times. This is useful to avoid false positives due to random failures. --- pyproject.toml | 4 ++-- scripts/test_stockwell.bat | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 scripts/test_stockwell.bat diff --git a/pyproject.toml b/pyproject.toml index 90f93d4..0be2b0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,5 +25,5 @@ before-build = './scripts/get_fftw3.sh' before-all = '%CONDA%\Scripts\conda.exe install fftw' before-build = 'pip install delvewheel' repair-wheel-command = 'delvewheel repair --add-path %CONDA%\Library\bin -w {dest_dir} {wheel}' -test-requires = '' -test-command = 'python -m stockwell.tests.test_stockwell' +test-requires = 'pytest' +test-command = '{package}\scripts\test_stockwell.bat' diff --git a/scripts/test_stockwell.bat b/scripts/test_stockwell.bat new file mode 100644 index 0000000..499b08b --- /dev/null +++ b/scripts/test_stockwell.bat @@ -0,0 +1,11 @@ +@echo off +REM Test Stockwell on Windows using pytest +REM Allows for a temporary test failure by repeating the test 5 times +REM (c) 2024 Claudio Satriano +set /a n=0 +:loop +pytest --pyargs stockwell && exit /b 0 +set /a n+=1 +if %n% gtr 5 goto :end +goto :loop +:end