14
14
import matplotlib .style
15
15
import matplotlib .units
16
16
import matplotlib .testing
17
- from matplotlib import cbook , ft2font , pyplot as plt , ticker , _pylab_helpers
17
+ from matplotlib import (_api , _pylab_helpers , cbook , ft2font , pyplot as plt ,
18
+ ticker )
18
19
from .compare import comparable_formats , compare_images , make_test_filename
19
20
from .exceptions import ImageComparisonFailure
20
21
@@ -31,6 +32,8 @@ def _cleanup_cm():
31
32
plt .close ("all" )
32
33
33
34
35
+ @_api .deprecated ("3.6" , alternative = "Vendor the existing code, "
36
+ "including the private function _cleanup_cm." )
34
37
class CleanupTestCase (unittest .TestCase ):
35
38
"""A wrapper for unittest.TestCase that includes cleanup operations."""
36
39
@classmethod
@@ -42,6 +45,8 @@ def tearDownClass(cls):
42
45
cls ._cm .__exit__ (None , None , None )
43
46
44
47
48
+ @_api .deprecated ("3.6" , alternative = "Vendor the existing code, "
49
+ "including the private function _cleanup_cm." )
45
50
def cleanup (style = None ):
46
51
"""
47
52
A decorator to ensure that any global state is reset before
@@ -83,7 +88,13 @@ def wrapped_callable(*args, **kwargs):
83
88
return make_cleanup
84
89
85
90
91
+ @_api .deprecated ("3.6" , alternative = "Vendor the existing code "
92
+ "of _check_freetype_version." )
86
93
def check_freetype_version (ver ):
94
+ return _check_freetype_version (ver )
95
+
96
+
97
+ def _check_freetype_version (ver ):
87
98
if ver is None :
88
99
return True
89
100
@@ -98,7 +109,7 @@ def check_freetype_version(ver):
98
109
def _checked_on_freetype_version (required_freetype_version ):
99
110
import pytest
100
111
return pytest .mark .xfail (
101
- not check_freetype_version (required_freetype_version ),
112
+ not _check_freetype_version (required_freetype_version ),
102
113
reason = f"Mismatched version of freetype. "
103
114
f"Test requires '{ required_freetype_version } ', "
104
115
f"you have '{ ft2font .__freetype_version__ } '" ,
0 commit comments