Problem with tests for psutil-7.2.0

"Bruce Dubbs" ([email protected] via blfs-dev Mailing List) <[email protected]> Sat, 27 Dec 2025 14:51:40 -0600
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <[email protected]>
I'm trying to update the book to psutil-7.2.0.  Building the wheel and installing is 
fine with current instructions.

$ pip3 list|grep psutil
psutil                        7.2.0

The problem I have is running the tests:

python3 -m venv --system-site-packages testenv                      &&
testenv/bin/pip3 install colorama pytest-{instafail,subtests,xdist} \
                          psleak pyperf pypinfo                      &&
PSUTIL_DEBUG=1 testenv/bin/python3 -m pytest

In the last line I get:

ERROR tests/test_aix.py
ERROR tests/test_bsd.py
ERROR tests/test_connections.py
ERROR tests/test_contracts.py
ERROR tests/test_heap.py
ERROR tests/test_linux.py
ERROR tests/test_memleaks.py
ERROR tests/test_misc.py
ERROR tests/test_osx.py
ERROR tests/test_posix.py
ERROR tests/test_process.py
ERROR tests/test_process_all.py
ERROR tests/test_scripts.py
ERROR tests/test_sudo.py
ERROR tests/test_sunos.py
ERROR tests/test_system.py
ERROR tests/test_testutils.py
ERROR tests/test_unicode.py
ERROR tests/test_windows.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 19 errors during collection

Looking at the output, all the tests have:

E   ImportError: cannot import name '_psutil_linux' from 'psutil' (consider renaming 
'/build/psutil/psutil-7.2.0/psutil/__init__.py' if it has the same name as a library 
you intended to import)

I renamed /build/psutil/psutil-7.2.0/psutil/__init__.py to x__init__.py and ran the 
tests again.  I now get:

FAILED tests/test_posix.py::TestSystemAPIs::test_disk_usage - assert 8379019264 < 4194304
FAILED tests/test_process_all.py::TestFetchAllProcesses::test_all - AssertionError: 
did not raise NoSuchProcess (psutil.Process(pid=13, name='kworker/R-mm_percpu_w...
FAILED tests/test_scripts.py::TestSetupScript::test_invocation - FileNotFoundError: 
[Errno 2] No such file or directory: '/build/psutil/psutil-7.2.0/psutil/__in...
FAILED tests/test_system.py::TestNetAPIs::test_net_if_addrs - KeyError: 'enp4s0'
====================== 4 failed, 523 passed, 171 skipped, 2 warnings in 6.69s

Only the first listed failure above is currently in the book.


My question is how best to put this into the book.

   -- Bruce

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page