mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-03 14:38:28 +08:00
[psutil] Add cache_clear to psutil.process_iter typing (#14803)
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user