Skip to content

Commit d7d937e

Browse files
authored
Update tests + coverage config to rm warnings. (#383)
Replace deprecated pytest behavior with suggested warnings.catch_warnings. Remove include from coverage configuration as it is ignored when source is set.
1 parent 9eb6f9b commit d7d937e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[run]
22
branch = True
33
source = numpydoc
4-
include = */numpydoc/*
54
omit =
65
*/setup.py
76
numpydoc/tests/*

numpydoc/tests/test_validate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import warnings
23
import numpydoc.validate
34
import numpydoc.tests
45

@@ -1377,7 +1378,7 @@ def test_bad_generic_functions(self, capsys, func):
13771378
],
13781379
)
13791380
def test_bad_docstrings(self, capsys, klass, func, msgs):
1380-
with pytest.warns(None) as w:
1381+
with warnings.catch_warnings(record=True) as w:
13811382
result = validate_one(self._import_path(klass=klass, func=func))
13821383
if len(w):
13831384
assert all('Unknown section' in str(ww.message) for ww in w)

0 commit comments

Comments
 (0)