diff options
| author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-02-01 11:15:05 +0000 |
|---|---|---|
| committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-02-15 04:34:10 +0000 |
| commit | c17300aa7a8aafb57eac91e1e3b15a4061ff2440 (patch) | |
| tree | 336b4de3eed73f98bb069c723649f574d4a3da88 /tests | |
| parent | a502e7523376e0344c1c9cc8a9d128143cd98b2d (diff) | |
| download | sphinx-git-c17300aa7a8aafb57eac91e1e3b15a4061ff2440.tar.gz | |
Treat Python warnings as errors during testing
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_ext_napoleon_iterators.py | 7 | ||||
| -rw-r--r-- | tests/test_setup_command.py | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_ext_napoleon_iterators.py b/tests/test_ext_napoleon_iterators.py index 7ecdb138d..a8357e4c6 100644 --- a/tests/test_ext_napoleon_iterators.py +++ b/tests/test_ext_napoleon_iterators.py @@ -3,8 +3,13 @@ import sys from unittest import TestCase +import pytest + from sphinx.deprecation import RemovedInSphinx70Warning -from sphinx.ext.napoleon.iterators import modify_iter, peek_iter + +with pytest.warns(DeprecationWarning, + match="sphinx.ext.napoleon.iterators is deprecated."): + from sphinx.ext.napoleon.iterators import modify_iter, peek_iter class ModuleIsDeprecatedTest(TestCase): diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py index ef364676c..510515125 100644 --- a/tests/test_setup_command.py +++ b/tests/test_setup_command.py @@ -33,7 +33,7 @@ def setup_command(request, tempdir, rootdir): proc = subprocess.Popen( command, - env=dict(os.environ, PYTHONPATH=pythonpath), + env=dict(os.environ, PYTHONPATH=pythonpath, PYTHONWARNINGS='default'), stdout=subprocess.PIPE, stderr=subprocess.PIPE) yield namedtuple('setup', 'pkgroot,proc')(pkgrootdir, proc) |
