Skip to content

Commit

Permalink
Update tests + coverage config to rm warnings. (#383)
Browse files Browse the repository at this point in the history
Replace deprecated pytest behavior with suggested
warnings.catch_warnings.

Remove include from coverage configuration as it is ignored when
source is set.
  • Loading branch information
rossbar committed Apr 18, 2022
1 parent 9eb6f9b commit d7d937e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[run]
branch = True
source = numpydoc
include = */numpydoc/*
omit =
*/setup.py
numpydoc/tests/*
Expand Down
3 changes: 2 additions & 1 deletion numpydoc/tests/test_validate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import warnings
import numpydoc.validate
import numpydoc.tests

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d7d937e

Please sign in to comment.