Skip to content

gh-138122: Remove redundant platform skips from external inspection tests - #163214

Open
maurycy wants to merge 3 commits into
python:mainfrom
maurycy:test-external-inspection-class-skips
Open

maurycy wants to merge 3 commits into
python:mainfrom
maurycy:test-external-inspection-class-skips

Conversation

@maurycy

@maurycy maurycy commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

@requires_remote_subprocess_debugging() already limits these tests to Linux, macOS, and Windows:

def requires_remote_subprocess_debugging():
"""Skip tests that require remote subprocess debugging permissions.
This also implies subprocess support, so no need to use both
@requires_subprocess() and @requires_remote_subprocess_debugging().
"""
if not has_subprocess_support:
return unittest.skip("requires subprocess support")
return unittest.skipUnless(
has_remote_subprocess_debugging(),
"requires remote subprocess debugging permissions"
)

if sys.platform not in ("linux", "darwin", "win32"):
return False
try:
import _remote_debugging
except ImportError:
return False
# On Linux, check for process_vm_readv support
if sys.platform == "linux":
if not getattr(_remote_debugging, "PROCESS_VM_READV_SUPPORTED", False):
return False

Remove redundant uses of @skip_if_not_supported. The class decorator also checks for process_vm_readv on Linux, so the 41 separate @unittest.skipIf checks are redundant too.

Inspired by this comment #163104 (comment)

@maurycy

maurycy commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

cc @ivonastojanovic

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

Labels

awaiting review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant