From 11f3b59a858945bcf8598f920834befd58b98d13 Mon Sep 17 00:00:00 2001 From: Sushobhana Patra Date: Mon, 4 Jun 2018 22:27:41 +0530 Subject: [PATCH 1/2] pytest deprecation warning : MarkInfo objects are deprecated MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly. Tried to change this according to their suggestion : Please use node.get_closest_marker(name) or node.iter_markers(name). https://docs.pytest.org/en/latest/mark.html#updating-code Test failing report for astropy/regions : https://travis-ci.org/astropy/regions/jobs/387743813 --- pytest_arraydiff/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_arraydiff/plugin.py b/pytest_arraydiff/plugin.py index 8bc4443..c13c651 100755 --- a/pytest_arraydiff/plugin.py +++ b/pytest_arraydiff/plugin.py @@ -212,7 +212,7 @@ def __init__(self, config, reference_dir=None, generate_dir=None, default_format def pytest_runtest_setup(self, item): - compare = item.keywords.get('array_compare') + compare = item.get_closest_marker('array_compare') if compare is None: return From a90edad1a4fb629690225b6c5a41c51e0415a517 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Tue, 4 Dec 2018 21:35:23 -0700 Subject: [PATCH 2/2] Preserve compatibility with older pytest versions --- pytest_arraydiff/plugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pytest_arraydiff/plugin.py b/pytest_arraydiff/plugin.py index c13c651..591e53b 100755 --- a/pytest_arraydiff/plugin.py +++ b/pytest_arraydiff/plugin.py @@ -36,6 +36,7 @@ import shutil import tempfile import warnings +from distutils.version import StrictVersion import six from six.moves.urllib.request import urlopen @@ -212,7 +213,11 @@ def __init__(self, config, reference_dir=None, generate_dir=None, default_format def pytest_runtest_setup(self, item): - compare = item.get_closest_marker('array_compare') + if StrictVersion(pytest.__version__) < StrictVersion("3.6"): + compare = item.get_marker('array_compare') + else: + compare = item.get_closest_marker('array_compare') + if compare is None: return