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

Sphinx 8.1: numpydoc test failures related to _exception_on_warning #13031

Closed
rossbar opened this issue Oct 17, 2024 · 1 comment
Closed

Sphinx 8.1: numpydoc test failures related to _exception_on_warning #13031

rossbar opened this issue Oct 17, 2024 · 1 comment
Labels

Comments

@rossbar
Copy link

rossbar commented Oct 17, 2024

Describe the bug

Numpydoc experienced test-suite failures in a mocked sphinx-app due to missing a private _exception_on_warning attribute. This started happening with sphinx 8.1 and is likely related to #12743.

Generally speaking, I don't think this is a problem with sphinx just a change in the underlying logic related to warningiserror and _exception_on_warning. It's likely the behavior change is intentional - in that case please close this. I just thought I'd raise it in case this is unexpected.

The fix in numpydoc is to explicitly add the _exception_on_warning attribute to the mocked sphinx app instance: numpy/numpydoc#586.

How to Reproduce

pip install numpydoc[test]==1.8.0 sphinx>=8.1
pytest --pyargs numpydoc

Environment Information

Package                       Version
----------------------------- -----------
alabaster                     1.0.0
babel                         2.16.0
certifi                       2024.8.30
charset-normalizer            3.4.0
contourpy                     1.3.0
coverage                      7.6.3
cycler                        0.12.1
docutils                      0.21.2
fonttools                     4.54.1
idna                          3.10
imagesize                     1.4.1
iniconfig                     2.0.0
Jinja2                        3.1.4
kiwisolver                    1.4.7
MarkupSafe                    3.0.1
matplotlib                    3.9.2
numpy                         2.1.2
numpydoc                      1.8.0
packaging                     24.1
pillow                        11.0.0
pip                           24.2
pluggy                        1.5.0
Pygments                      2.18.0
pyparsing                     3.2.0
pytest                        8.3.3
pytest-cov                    5.0.0
python-dateutil               2.9.0.post0
requests                      2.32.3
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        8.1.3
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-devhelp         2.0.0
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 2.0.0
tabulate                      0.9.0
urllib3                       2.2.3

Sphinx extensions

numpydoc

Additional context

No response

@AA-Turner
Copy link
Member

Indeed, mocking sphinx.application.Sphinx isn't a supported use-case, so I don't consider this a bug -- but adding the private _exception_on_warning attribute is the correct resolution.

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants