1414import matplotlib .style
1515import matplotlib .units
1616import 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 )
1819from .compare import comparable_formats , compare_images , make_test_filename
1920from .exceptions import ImageComparisonFailure
2021
@@ -31,6 +32,8 @@ def _cleanup_cm():
3132 plt .close ("all" )
3233
3334
35+ @_api .deprecated ("3.6" , alternative = "Vendor the existing code, "
36+ "including the private function _cleanup_cm." )
3437class CleanupTestCase (unittest .TestCase ):
3538 """A wrapper for unittest.TestCase that includes cleanup operations."""
3639 @classmethod
@@ -42,6 +45,8 @@ def tearDownClass(cls):
4245 cls ._cm .__exit__ (None , None , None )
4346
4447
48+ @_api .deprecated ("3.6" , alternative = "Vendor the existing code, "
49+ "including the private function _cleanup_cm." )
4550def cleanup (style = None ):
4651 """
4752 A decorator to ensure that any global state is reset before
@@ -83,7 +88,13 @@ def wrapped_callable(*args, **kwargs):
8388 return make_cleanup
8489
8590
91+ @_api .deprecated ("3.6" , alternative = "Vendor the existing code "
92+ "of _check_freetype_version." )
8693def check_freetype_version (ver ):
94+ return _check_freetype_version (ver )
95+
96+
97+ def _check_freetype_version (ver ):
8798 if ver is None :
8899 return True
89100
@@ -98,7 +109,7 @@ def check_freetype_version(ver):
98109def _checked_on_freetype_version (required_freetype_version ):
99110 import pytest
100111 return pytest .mark .xfail (
101- not check_freetype_version (required_freetype_version ),
112+ not _check_freetype_version (required_freetype_version ),
102113 reason = f"Mismatched version of freetype. "
103114 f"Test requires '{ required_freetype_version } ', "
104115 f"you have '{ ft2font .__freetype_version__ } '" ,
0 commit comments