diff --git a/.coveragerc b/.coveragerc index efab5a67..251f5155 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,6 @@ [run] branch = True source = numpydoc -include = */numpydoc/* omit = */setup.py numpydoc/tests/* diff --git a/numpydoc/tests/test_validate.py b/numpydoc/tests/test_validate.py index 0e27dc83..3f2d4429 100644 --- a/numpydoc/tests/test_validate.py +++ b/numpydoc/tests/test_validate.py @@ -1,4 +1,5 @@ import pytest +import warnings import numpydoc.validate import numpydoc.tests @@ -1377,7 +1378,7 @@ def test_bad_generic_functions(self, capsys, func): ], ) def test_bad_docstrings(self, capsys, klass, func, msgs): - with pytest.warns(None) as w: + with warnings.catch_warnings(record=True) as w: result = validate_one(self._import_path(klass=klass, func=func)) if len(w): assert all('Unknown section' in str(ww.message) for ww in w)