Skip to content

8.0.0: pytest is failing #215

Open
Open
@kloczek

Description

@kloczek

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix> using 'installer` module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-spelling-8.0.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-spelling-8.0.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/spelling-8.0.0
collected 6 items / 2 errors

========================================================================================== ERRORS ===========================================================================================
__________________________________________________________________________ ERROR collecting tests/test_builder.py ___________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/spelling-8.0.0/tests/test_builder.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_builder.py:16: in <module>
    from tests import helpers  # isort:skip
E   ModuleNotFoundError: No module named 'tests'
___________________________________________________________________________ ERROR collecting tests/test_filter.py ___________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/spelling-8.0.0/tests/test_filter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_filter.py:16: in <module>
    from tests import helpers # isort:skip
E   ModuleNotFoundError: No module named 'tests'
================================================================================== short test summary info ==================================================================================
ERROR tests/test_builder.py
ERROR tests/test_filter.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 2 errors in 0.35s =====================================================================================

Here is list of installed modules in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.13
Babel                         2.12.1
build                         0.10.0
charset-normalizer            3.1.0
distro                        1.8.0
docutils                      0.19
exceptiongroup                1.0.0
fixtures                      4.0.1
gpg                           1.19.0
idna                          3.4
imagesize                     1.4.1
importlib-metadata            6.5.0
iniconfig                     2.0.0
installer                     0.7.0
Jinja2                        3.1.2
libcomps                      0.1.19
MarkupSafe                    2.1.2
packaging                     23.0
pbr                           5.11.1
pluggy                        1.0.0
pyenchant                     3.2.2
Pygments                      2.15.1
pyproject_hooks               1.0.0
pytest                        7.3.1
python-dateutil               2.8.2
pytz                          2023.2
requests                      2.28.2
setuptools                    67.6.1
setuptools-scm                7.1.0
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        6.1.3
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2.dev20230415
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20230415
sphinxcontrib-qthelp          1.0.3.dev20230415
sphinxcontrib-serializinghtml 1.1.5
sphinxcontrib-spelling        7.7.0
tomli                         2.0.1
typing_extensions             4.5.0
urllib3                       1.26.15
wheel                         0.40.0
zipp                          3.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions