Commit d7726a3
committed
Make _warn_external correctly report warnings arising from tests.
Before the PR:
```
$ pytest lib/matplotlib/tests/test_cbook.py::test_is_hashable
<elided>
lib/matplotlib/tests/test_cbook.py::test_is_hashable
.../site-packages/_pytest/python.py:166: MatplotlibDeprecationWarning:
The is_hashable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use isinstance(..., collections.abc.Hashable) instead.
testfunction(**testargs)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
```
After
```
$ pytest lib/matplotlib/tests/test_cbook.py::test_is_hashable
<elided>
lib/matplotlib/tests/test_cbook.py::test_is_hashable
.../lib/matplotlib/tests/test_cbook.py:22: MatplotlibDeprecationWarning:
The is_hashable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use isinstance(..., collections.abc.Hashable) instead.
assert cbook.is_hashable(s)
lib/matplotlib/tests/test_cbook.py::test_is_hashable
.../lib/matplotlib/tests/test_cbook.py:25: MatplotlibDeprecationWarning:
The is_hashable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use isinstance(..., collections.abc.Hashable) instead.
assert not cbook.is_hashable(lst)
```1 parent 83cb3ef commit d7726a3
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
2044 | | - | |
| 2044 | + | |
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
0 commit comments