diff --git a/.github/workflows/build-test-package-python-cuda.yml b/.github/workflows/build-test-package-python-cuda.yml index d31a410..5468a1e 100644 --- a/.github/workflows/build-test-package-python-cuda.yml +++ b/.github/workflows/build-test-package-python-cuda.yml @@ -233,4 +233,14 @@ jobs: pip install cupy-cuda12x torch pip install pytest - pytest $GITHUB_WORKSPACE/test/*.py + + # Run tests with warning detection. + # SWIG < 4.4 triggers the Py_LIMITED_API "builtin type swig…" warning when + # Python runs with -Walways; pytest enables that behavior, so we ignore it. + stderr_log=$(mktemp) + pytest $GITHUB_WORKSPACE/test/*.py -vv -s -W "ignore:builtin type swig" 2> "$stderr_log" + if grep -q "Warning" "$stderr_log"; then + echo "Warnings found in stderr, failing the build" + cat "$stderr_log" + exit 1 + fi