mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Treat Python warnings as errors during testing
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user