Commit b838e86
committed
Fix warnings from updated marker API in pytest 3.6
Use of item.get_marker was deprecated. Tests with the matplotlib decorator
run but result in warnings such as:
tests/test_visualization.py::test_show_checkerboard_overlay
/home/_/venvs/python3.6/site-packages/pytest_mpl/plugin.py:175: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
Please use node.get_closest_marker(name) or node.iter_markers(name).
Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
tolerance = compare.kwargs.get('tolerance', 2)
This patch uses get_closest_marker instead of the get_marker and fixes the issue.
See also:
Marker revamp and iteration
https://docs.pytest.org/en/latest/mark.html#updating-code1 parent 574299c commit b838e86
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| |||
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
172 | | - | |
| 181 | + | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
| |||
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
298 | | - | |
| 307 | + | |
299 | 308 | | |
300 | 309 | | |
301 | 310 | | |
| |||
0 commit comments