Skip to content

Commit 6c8bec9

Browse files
authored
Merge pull request #15 from sushobhana/patch-1
pytest deprecation warning : MarkInfo objects are deprecated
2 parents 2977bcb + a90edad commit 6c8bec9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pytest_arraydiff/plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import shutil
3737
import tempfile
3838
import warnings
39+
from distutils.version import StrictVersion
3940

4041
import six
4142
from six.moves.urllib.request import urlopen
@@ -212,7 +213,11 @@ def __init__(self, config, reference_dir=None, generate_dir=None, default_format
212213

213214
def pytest_runtest_setup(self, item):
214215

215-
compare = item.keywords.get('array_compare')
216+
if StrictVersion(pytest.__version__) < StrictVersion("3.6"):
217+
compare = item.get_marker('array_compare')
218+
else:
219+
compare = item.get_closest_marker('array_compare')
220+
216221

217222
if compare is None:
218223
return

0 commit comments

Comments
 (0)