File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ name: Reusable Lazy Imports Tests
66# Modules that are known to fail under lazy imports are listed in
77# Lib/test/lazy_imports_all_exclude.txt and skipped here. Remove entries from
88# that file as the modules are fixed so this workflow starts guarding them
9- # against regressions.
9+ # against regressions. Excluded modules are also checked separately so the
10+ # workflow fails when one starts passing and its exclusion should be removed.
1011
1112on :
1213 workflow_call :
6162 echo "Excluding $(wc -l < exclude_tests.txt) module(s); running $(wc -l < run_tests.txt) of $(wc -l < all_tests.txt)."
6263 - name : Run stdlib tests with lazy imports
6364 run : xvfb-run xargs ./python -m test --fast-ci --timeout=900 < run_tests.txt
65+ - name : Verify excluded tests still need exclusion
66+ if : success()
67+ run : |
68+ set -euo pipefail
69+ unexpected_passes=()
70+ while IFS= read -r test_name; do
71+ [ -n "$test_name" ] || continue
72+ echo "Checking excluded test: $test_name"
73+ if xvfb-run ./python -m test --fast-ci --timeout=900 "$test_name"; then
74+ unexpected_passes+=("$test_name")
75+ fi
76+ done < exclude_tests.txt
77+ if [ "${#unexpected_passes[@]}" -ne 0 ]; then
78+ echo "::error::These tests still appear in $EXCLUDE_FILE but now pass with PYTHON_LAZY_IMPORTS=all. Remove them from the exclude file:"
79+ printf '%s\n' "${unexpected_passes[@]}"
80+ exit 1
81+ fi
Original file line number Diff line number Diff line change 66# here. Exclusion is whole-module: a listed module is skipped entirely, so any
77# passing tests it contains are not covered until its line is removed. As each
88# module is fixed, delete its line so the workflow starts guarding it against
9- # regressions.
9+ # regressions. The workflow also checks listed modules separately and fails if
10+ # one now passes, so accidental fixes prompt cleanup of this file.
1011#
1112# Format: one test name per line, exactly as printed by
1213# ``python -m test --list-tests``. Lines starting with ``#`` and blank lines
You can’t perform that action at this time.
0 commit comments