File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 4141from urllib .request import urlopen
4242
4343import pytest
44+ from packaging .version import Version
4445
4546from pytest_mpl .summary .html import generate_summary_basic_html , generate_summary_html
4647
5657 Actual shape: {actual_shape}
5758 {actual_path}"""
5859
60+ PYTEST_LT_7 = Version (pytest .__version__ ) < Version ("7.0.0" )
61+
5962# The following are the subsets of formats supported by the Matplotlib image
6063# comparison machinery
6164RASTER_IMAGE_FORMATS = ['png' ]
6467
6568
6669def _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
6972
7073
7174def _hash_file (in_stream ):
You can’t perform that action at this time.
0 commit comments