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 58
58
{actual_path}"""
59
59
60
60
PYTEST_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' )])
61
64
62
65
# The following are the subsets of formats supported by the Matplotlib image
63
66
# comparison machinery
@@ -128,11 +131,19 @@ def wrapper(*args, **kwargs):
128
131
item .obj = figure_interceptor (plugin , item .obj )
129
132
130
133
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__ )]
136
147
137
148
138
149
def pytest_addoption (parser ):
You can’t perform that action at this time.
0 commit comments