astropy / sphinx-automodapi

Sphinx extension for generating API documentation
https://sphinx-automodapi.readthedocs.io
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

0.11: test_run_full_case fails with "nested" #83

Closed olebole closed 5 years ago

olebole commented 5 years ago

When testing 0.11, I get the following failure:

__ test_run_full_case[/usr/lib/python3/dist-packages/sphinx_automodapi/tests/cases/nested-False] __

tmpdir = local('/tmp/pytest-of-oles/pytest-11/test_run_full_case__usr_lib_py16')
case_dir = '/usr/lib/python3/dist-packages/sphinx_automodapi/tests/cases/nested', parallel = False

    @pytest.mark.parametrize(('case_dir', 'parallel'), product(CASES_DIRS, PARALLEL))
    def test_run_full_case(tmpdir, case_dir, parallel):
[…]    

        # Check that all expected output files are there and match the reference files
        for root, dirnames, filenames in os.walk(output_dir):
            for filename in filenames:
                path_reference = os.path.join(root, filename)
                path_relative = os.path.relpath(path_reference, output_dir)
                path_actual = os.path.join(docs_dir, path_relative)
>               assert os.path.exists(path_actual)
E               AssertionError: assert False
E                +  where False = <function exists at 0x7f44ca243ef0>('/tmp/pytest-of-oles/pytest-11/test_run_full_case__usr_lib_py16/docs/api/sphinx_automodapi.tests.example_module.functions_with_ref.add.rst')
E                +    where <function exists at 0x7f44ca243ef0> = <module 'posixpath' from '/usr/lib/python3.7/posixpath.py'>.exists
E                +      where <module 'posixpath' from '/usr/lib/python3.7/posixpath.py'> = os.path

/usr/lib/python3/dist-packages/sphinx_automodapi/tests/test_cases.py:132: AssertionError
-------------------------------------- Captured stdout call ---------------------------------------
Running Sphinx v1.8.5
making output directory...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] index

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index

generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 1 warning.

The HTML pages are in _build/html.
-------------------------------------- Captured stderr call ---------------------------------------
/tmp/pytest-of-oles/pytest-11/test_run_full_case__usr_lib_py16/docs/index.rst:1: WARNING: toctree contains reference to nonexisting document 'tests/example_module/index'

The same happens for parallel=True. I get this failure both during build time and when the package is installed. The easiest way to reproduce is (on a Debian Buster system)

$ pip3 install sphinx-automodapi
$ pytest-3 --pyargs sphinx_automodapi
astrofrog commented 5 years ago

I can reproduce this if I run the tests in an isolated environment with tox. I'll fix this shortly.

astrofrog commented 5 years ago

This should be fixed by https://github.com/astropy/sphinx-automodapi/pull/84, but I'll leave this open until a new release is made.

astrofrog commented 5 years ago

sphinx-automodapi v0.12 is released: https://pypi.org/project/sphinx-automodapi/0.12/

olebole commented 5 years ago

Thank you; I just uploaded the updated Debian package.