Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.6: pytest is failing in tests/test_contributors.py::test_contributor_directive unit #26

Open
kloczek opened this issue Dec 27, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kloczek
Copy link

kloczek commented Dec 27, 2022

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>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-contributors-0.2.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-contributors-0.2.6-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.16, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-contributors-0.2.6
collected 10 items

tests/test_contributors.py .........F                                                                                                                                [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________________________ test_contributor_directive ________________________________________________________________________

tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-17/test_contributor_directive0')

    def test_contributor_directive(tmp_path: Path) -> None:
        """
        The ``contributors`` directive runs with no errors.
        """
        source_directory = tmp_path / "source"
        source_directory.mkdir()
        source_file = source_directory / "index.rst"
        conf_py = source_directory / "conf.py"
        conf_py.touch()
        source_file.touch()
        conf_py_content = dedent(
            """\
            extensions = ['sphinx_contributors']
            """,
        )
        conf_py.write_text(conf_py_content)
        source_file_content = dedent(
            """\
            .. contributors:: sphinx-doc/sphinx
            """,
        )
        source_file.write_text(source_file_content)
        destination_directory = tmp_path / "destination"
        args = [
            sys.executable,
            "-m",
            "sphinx",
            "-b",
            "html",
            "-W",
            # Directory containing source and configuration files.
            str(source_directory),
            # Directory containing build files.
            str(destination_directory),
            # Source file to process.
            str(source_file),
        ]
        result = subprocess.run(
            args=args,
            check=False,
            stderr=subprocess.PIPE,
        )
>       assert result.returncode == 0
E       AssertionError: assert 2 == 0
E        +  where 2 = CompletedProcess(args=['/usr/bin/python3', '-m', 'sphinx', '-b', 'html', '-W', '/tmp/pytest-of-tkloczko/pytest-17/test.../index.rst'], returncode=2, stderr=b'\nWarning, treated as error:\nThe repository sphinx-doc/sphinx does not exist.\n').returncode

tests/test_contributors.py:179: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Running Sphinx v5.3.0
making output directory... done
building [mo]: targets for 0 po files that are specified
building [html]: 1 source files given on command line
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index

========================================================================= short test summary info ==========================================================================
FAILED tests/test_contributors.py::test_contributor_directive - AssertionError: assert 2 == 0
================================================================= 1 failed, 9 passed in 120.91s (0:02:00) ==================================================================

Here is list of installed modules in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
apeye                         1.2.0
appdirs                       1.4.4
asciidoc                      10.2.0
attrs                         22.2.0
Babel                         2.11.0
Brlapi                        0.8.3
build                         0.9.0
charset-normalizer            3.0.1
contourpy                     1.0.6
cssselect                     1.1.0
cycler                        0.11.0
dist-meta                     0.6.0
distro                        1.8.0
dnspython                     2.2.1
docutils                      0.19
dom_toml                      0.6.0
domdf-python-tools            3.3.0
exceptiongroup                1.0.0
extras                        1.0.0
fixtures                      4.0.0
fonttools                     4.38.0
gpg                           1.18.0-unknown
handy-archives                0.1.2
idna                          3.4
imagesize                     1.4.1
importlib-metadata            5.1.0
iniconfig                     1.1.1
Jinja2                        3.1.2
kiwisolver                    1.4.4
libcomps                      0.1.19
louis                         3.24.0
lxml                          4.9.1
Mako                          1.2.4.dev0
MarkupSafe                    2.1.1
matplotlib                    3.6.2
natsort                       8.0.2
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pbr                           5.9.0
pep517                        0.13.0
Pillow                        9.3.0
pip                           22.3.1
platformdirs                  2.6.0
pluggy                        1.0.0
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pypi-json                     0.3.0
pytest                        7.2.0
python-dateutil               2.8.2
pytz                          2022.4
requests                      2.28.1
rpm                           4.17.0
scour                         0.38.2
seed-intersphinx-mapping      1.1.0
setuptools                    65.6.3
shippinglabel                 1.4.1
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        5.3.0
sphinxcontrib-applehelp       1.0.2.dev20221204
sphinxcontrib-devhelp         1.0.2.dev20221204
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20221204
sphinxcontrib-qthelp          1.0.3.dev20221204
sphinxcontrib-serializinghtml 1.1.5
testtools                     2.5.0
toml                          0.10.2
tomli                         2.0.1
typing_extensions             4.4.0
urllib3                       1.26.12
wheel                         0.38.4
zipp                          3.11.0
@dgarcia360 dgarcia360 added the bug Something isn't working label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants