Ignore warnings for numpydocs

This commit is contained in:
Dave Halter
2019-06-10 21:41:15 +02:00
parent 1b0677ec55
commit c1047bef4f

View File

@@ -16,6 +16,7 @@ annotations.
"""
import re
import warnings
from textwrap import dedent
from parso import parse, ParserSyntaxError
@@ -60,6 +61,8 @@ def _get_numpy_doc_string_cls():
def _search_param_in_numpydocstr(docstr, param_str):
"""Search `docstr` (in numpydoc format) for type(-s) of `param_str`."""
with warnings.catch_warnings():
warnings.simplefilter("ignore")
try:
# This is a non-public API. If it ever changes we should be
# prepared and return gracefully.
@@ -79,6 +82,8 @@ def _search_return_in_numpydocstr(docstr):
"""
Search `docstr` (in numpydoc format) for type(-s) of function returns.
"""
with warnings.catch_warnings():
warnings.simplefilter("ignore")
try:
doc = _get_numpy_doc_string_cls()(docstr)
except Exception: