Skip to content

0.6.0: pytest fails in tests/test_setup.py::test_setup unit #86

@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-default-values-0.6.0-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-default-values-0.6.0-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/default_values-0.6.0
configfile: tox.ini
plugins: datadir-1.5.0, regressions-2.5.0, timeout-2.3.1
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 53 items

tests/test_format_default_value.py ........................              [ 45%]
tests/test_process_default_format.py ...............                     [ 73%]
tests/test_process_docstring.py .............                            [ 98%]
tests/test_setup.py F                                                    [100%]

=================================== FAILURES ===================================
__________________________________ test_setup __________________________________

    def test_setup():

        app: Sphinx
        setup_ret, directives, roles, additional_nodes, app = run_setup(sphinxcontrib.default_values.setup)

        assert setup_ret == {
                        "version": __version__,
                        "parallel_read_safe": True,
                        "parallel_write_safe": True,
                        }

>       assert app.config.values["default_description_format"] == ("Default %s", "env", [str])
E    AssertionError: assert _Opt(default=...escription='') == ('Default %s'...class 'str'>])
E
E      Use -v to get more diff

tests/test_setup.py:41: AssertionError
============================= slowest 25 durations =============================
0.01s call     tests/test_process_docstring.py::test_process_docstring_demo

(24 durations < 0.005s hidden.  Use -vv to show these durations.)
=========================== short test summary info ============================
FAILED tests/test_setup.py::test_setup - AssertionError: assert _Opt(default=...escription='') == ('Default %s'...cl...
========================= 1 failed, 52 passed in 0.68s =========================
List of installed modules in build env:
Package                       Version
----------------------------- -----------
alabaster                     0.7.16
apeye                         1.4.1
apeye-core                    1.1.4
attrs                         24.2.0
autodocsumm                   0.2.14
babel                         2.16.0
beautifulsoup4                4.12.3
build                         1.2.2.post1
CacheControl                  0.14.1
charset-normalizer            3.4.0
click                         8.1.7
coincidence                   0.6.6
consolekit                    1.7.2
cssutils                      2.11.1
defusedxml                    0.7.1
deprecation                   2.1.0
deprecation-alias             0.3.2
dict2css                      0.3.0.post1
dist-meta                     0.8.0
distro                        1.9.0
docutils                      0.21.2
dom_toml                      1.0.0
domdf_python_tools            3.8.0.post2
exceptiongroup                1.1.3
extras-require                0.5.0
filelock                      3.16.1
handy-archives                0.2.0
html-section                  0.3.0
html5lib                      1.1
imagesize                     1.4.1
importlib_metadata            8.5.0
iniconfig                     2.0.0
installer                     0.7.0
Jinja2                        3.1.4
MarkupSafe                    3.0.2
mistletoe                     1.3.0
more-itertools                10.5.0
msgpack                       1.0.8
natsort                       8.4.0
packaging                     24.0
platformdirs                  4.3.6
pluggy                        1.5.0
pychoosealicense              2023.11.20
Pygments                      2.18.0
pypi-json                     0.4.0
pyproject_hooks               1.2.0
pyproject-parser              0.9.1
pytest                        8.2.2
pytest-datadir                1.5.0
pytest-regressions            2.5.0
pytest-timeout                2.3.1
python-dateutil               2.9.0.post0
python-frontmatter            1.1.0
PyYAML                        6.0.2
requests                      2.32.3
ruamel.yaml                   0.18.5
ruamel.yaml.clib              0.2.8
seed-intersphinx-mapping      1.2.2
setuptools                    75.1.0
shippinglabel                 1.7.2
snowballstemmer               2.2.0
soupsieve                     2.6
Sphinx                        8.1.3
sphinx-autodoc-typehints      2.5.0
sphinx-copybutton             0.5.2
sphinx-debuginfo              0.2.2.post1
sphinx-jinja2-compat          0.3.0
sphinx-licenseinfo            0.5.0
sphinx-notfound-page          1.0.4
sphinx-prompt                 1.6.0
sphinx-pyproject              0.3.0
sphinx-tabs                   3.4.7
sphinx-toolbox                3.8.1
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-devhelp         1.0.6
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 2.0.0
sphinxemoji                   0.2.0
tabulate                      0.9.0
toctree-plus                  0.6.1
tokenize_rt                   6.1.0
toml                          0.10.2
tomli                         2.0.1
typing_extensions             4.12.2
urllib3                       2.2.2
webencodings                  0.5.1
wheel                         0.45.0
whey                          0.0.26
zipp                          3.21.0

Please let me know if you need more details or want me to perform some diagnostics.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions