[psutil] Add cache_clear to psutil.process_iter typing (#14803)

This commit is contained in:
Emmanuel Ferdman
2025-09-30 14:59:31 +02:00
committed by GitHub
parent 6a7f3190b1
commit 8845352c2e
3 changed files with 30 additions and 4 deletions
@@ -8,3 +8,6 @@ psutil._pssunos
# Test utilities
psutil.tests.*
# process_iter is enhanced with cache_clear method that's not detected by stubtest
psutil.process_iter
@@ -0,0 +1,16 @@
"""Test cases for psutil.process_iter and its cache_clear method."""
from __future__ import annotations
import psutil
# Test that process_iter can be called as a function
for proc in psutil.process_iter():
break
# Test that process_iter has cache_clear method
psutil.process_iter.cache_clear()
# Test that cache_clear is callable
clear_method = psutil.process_iter.cache_clear
clear_method()