File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 41
41
from urllib .request import urlopen
42
42
43
43
import pytest
44
+ from packaging .version import Version
44
45
45
46
from pytest_mpl .summary .html import generate_summary_basic_html , generate_summary_html
46
47
56
57
Actual shape: {actual_shape}
57
58
{actual_path}"""
58
59
60
+ PYTEST_LT_7 = Version (pytest .__version__ ) < Version ("7.0.0" )
61
+
59
62
# The following are the subsets of formats supported by the Matplotlib image
60
63
# comparison machinery
61
64
RASTER_IMAGE_FORMATS = ['png' ]
64
67
65
68
66
69
def _get_item_dir (item ):
67
- # . path is available starting from pytest 7, .fspath is for older versions.
68
- return getattr ( item , " path" , Path ( item . fspath )) .parent
70
+ path = Path ( item .fspath ) if PYTEST_LT_7 else item . path
71
+ return path .parent
69
72
70
73
71
74
def _hash_file (in_stream ):
You can’t perform that action at this time.
0 commit comments