Skip to content

6.1.0: running self tests #2465

Open
Open
@0-wiz-0

Description

In 6.1.0 the test system was switched from unittest to pytest. I've updated the package in pkgsrc using the pypi source distfile, but I can't run the tests any longer. Using the command line from HISTORY.rst:

/usr/pkg/bin/python3.12 -m psutil.tests
/usr/pkg/bin/python3.12: Error while finding module specification for 'psutil.tests' (ImportError: cannot import name '_psutil_bsd' from partially initialized module 'psutil' (most likely due to a circular import) (/scratch/sysutils/py-psutil/work/psutil-6.1.0/psutil/__init__.py))

Using pytest directly, from the top level:

====================================================================================== test session starts =======================================================================================
platform netbsd10 -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
rootdir: /scratch/sysutils/py-psutil/work/psutil-6.1.0
configfile: pyproject.toml
collected 0 items / 16 errors

============================================================================================= ERRORS =============================================================================================
___________________________________________________________________________ ERROR collecting psutil/tests/test_aix.py ____________________________________________________________________________
ImportError while importing test module '/scratch/sysutils/py-psutil/work/psutil-6.1.0/psutil/tests/test_aix.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/pkg/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
psutil/__init__.py:127: in <module>
    from . import _psbsd as _psplatform
psutil/_psbsd.py:17: in <module>
    from . import _psutil_bsd as cext
E   ImportError: cannot import name '_psutil_bsd' from partially initialized module 'psutil' (most likely due to a circular import) (/scratch/sysutils/py-psutil/work/psutil-6.1.0/psutil/__init__
.py)
___________________________________________________________________________ ERROR collecting psutil/tests/test_bsd.py ____________________________________________________________________________
...

It doesn't matter if I install the package first or not.
In case it matters, in pkgsrc, the package is built using:

/usr/pkg/bin/python3.12  -m build --wheel --skip-dependency-check --no-isolation

What is the proper way to run the tests now?
Thanks.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions