Skip to content

Commit

Permalink
Replace deprecated pytest.warns(None)
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Jul 12, 2024
1 parent 4bd7800 commit 71a15d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests_regression/helpers/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from itertools import chain, zip_longest
from pathlib import Path
from warnings import catch_warnings

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

0 comments on commit 71a15d3

Please sign in to comment.