Treat Python warnings as errors during testing

This commit is contained in:
Adam Turner
2023-02-01 11:15:05 +00:00
parent a502e75233
commit c17300aa7a
6 changed files with 21 additions and 6 deletions

View File

@@ -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):

View File

@@ -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)