Skip to content

gh-131684: Ignore unittest.SkipTest in pkgutil.walk_packages#148926

Open
RezSat wants to merge 1 commit intopython:mainfrom
RezSat:gh-131684-pkgutil-skiptest
Open

gh-131684: Ignore unittest.SkipTest in pkgutil.walk_packages#148926
RezSat wants to merge 1 commit intopython:mainfrom
RezSat:gh-131684-pkgutil-skiptest

Conversation

@RezSat
Copy link
Copy Markdown

@RezSat RezSat commented Apr 23, 2026

Fixes gh-131684.

pkgutil.walk_packages() currently ignores ImportError by default but still
propagates unittest.SkipTest raised during package imports when no onerror
callback is provided.

This change makes walk_packages() ignore unittest.SkipTest by default in
that case so iteration can continue.

Also added a regression test in Lib/test/test_pkgutil.py and a NEWS entry.

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented Apr 23, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkgutil.walk_packages(None) imports tests and then their SkipTest exceptions ends iteration

1 participant