Skip to content

Commit 71a15d3

Browse files
committed
Replace deprecated pytest.warns(None)
1 parent 4bd7800 commit 71a15d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests_regression/helpers/regression.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from itertools import chain, zip_longest
1212
from pathlib import Path
13+
from warnings import catch_warnings
1314

1415
from sphinx.application import Sphinx
1516
from sphinx.util.docutils import docutils_namespace
@@ -133,7 +134,7 @@ def render_doctree(doctree, out_dir, out_filename, reference_path,
133134
document = MinimalTemplate(doctree)
134135
output_dir = out_dir / out_filename
135136
output_dir.mkdir(parents=True, exist_ok=True)
136-
with pytest.warns(None) as recorded_warnings:
137+
with catch_warnings(record=True) as recorded_warnings:
137138
document.render(output_dir / out_filename)
138139
if 'warnings' in document.metadata:
139140
warnings_node = document.metadata['warnings'].source.node

0 commit comments

Comments
 (0)