Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Milestone
Description
Bug report
Bug summary
sphinx-build
has a-W
option to turn warnings into errors. However, this doesn't seem to have any effect on warnings emitted inside plot directives.
Code for reproduction
To reproduce, create an empty directory then add aconf.py
file with:
importmatplotlib.sphinxext.plot_directiveextensions= [matplotlib.sphinxext.plot_directive.__name__]
and anindex.rst
file with:
.. plot:: import warnings warnings.warn("A warning occurred")
Then run:
sphinx-build -b html -d _build/doctrees . _build/html -W
The-W
flag should turn warnings into errors, but this is not the case.
Actual outcome
Running Sphinx v2.3.0+making output directory... donebuilding [mo]: targets for 0 po files that are out of datebuilding [html]: targets for 1 source files that are out of dateupdating environment: [new config] 1 added, 0 changed, 0 removed<string>:2: UserWarning: A warning occurred looking for now-outdated files... none foundpickling environment... donechecking consistency... donepreparing documents... donewriting output... [100%] index generating indices... genindexdonewriting additional pages... searchdonecopying static files... ... donecopying extra files... donedumping search index in English (code: en)... donedumping object inventory... donebuild succeeded.
Expected outcome
The build should fail with an error.
Matplotlib version
- Operating system: Ubuntu 19.10
- Matplotlib version: 3.2.0rc1 (from pip)
- Python version: 3.7.3