File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 5858 {actual_path}"""
5959
6060PYTEST_LT_7 = Version (pytest .__version__ ) < Version ("7.0.0" )
61+ PYTEST_GE_8_0 = any ([_pytest_version .is_devrelease ,
62+ _pytest_version .is_prerelease ,
63+ _pytest_version >= Version ('8.0' )])
6164
6265# The following are the subsets of formats supported by the Matplotlib image
6366# comparison machinery
@@ -128,11 +131,19 @@ def wrapper(*args, **kwargs):
128131 item .obj = figure_interceptor (plugin , item .obj )
129132
130133
131- def pytest_report_header (config , startdir ):
132- import matplotlib
133- import matplotlib .ft2font
134- return ["Matplotlib: {0}" .format (matplotlib .__version__ ),
135- "Freetype: {0}" .format (matplotlib .ft2font .__freetype_version__ )]
134+ if PYTEST_GE_8_0 :
135+ def pytest_report_header (config , start_path ):
136+ import matplotlib
137+ import matplotlib .ft2font
138+ return ["Matplotlib: {0}" .format (matplotlib .__version__ ),
139+ "Freetype: {0}" .format (matplotlib .ft2font .__freetype_version__ )]
140+
141+ else :
142+ def pytest_report_header (config , startdir ):
143+ import matplotlib
144+ import matplotlib .ft2font
145+ return ["Matplotlib: {0}" .format (matplotlib .__version__ ),
146+ "Freetype: {0}" .format (matplotlib .ft2font .__freetype_version__ )]
136147
137148
138149def pytest_addoption (parser ):
You can’t perform that action at this time.
0 commit comments