|
12 | 12 | import warnings |
13 | 13 | import unittest |
14 | 14 |
|
15 | | -# Note - don't import nose up here - import it only as needed in functions. This |
16 | | -# allows other functions here to be used by pytest-based testing suites without |
17 | | -# requiring nose to be installed. |
| 15 | +# Note - don't import nose up here - import it only as needed in functions. |
| 16 | +# This allows other functions here to be used by pytest-based testing suites |
| 17 | +# without requiring nose to be installed. |
18 | 18 |
|
19 | 19 | import numpy as np |
20 | 20 |
|
@@ -163,7 +163,7 @@ def wrapped_callable(*args, **kwargs): |
163 | 163 | return make_cleanup |
164 | 164 | else: |
165 | 165 | result = make_cleanup(style) |
166 | | - style = 'classic' |
| 166 | + style = '_classic_test' |
167 | 167 | return result |
168 | 168 |
|
169 | 169 |
|
@@ -268,43 +268,42 @@ def do_test(fignum, actual_fname, expected_fname): |
268 | 268 |
|
269 | 269 | def image_comparison(baseline_images=None, extensions=None, tol=0, |
270 | 270 | freetype_version=None, remove_text=False, |
271 | | - savefig_kwarg=None, style='classic'): |
| 271 | + savefig_kwarg=None, style='_classic_test'): |
272 | 272 | """ |
273 | 273 | Compare images generated by the test with those specified in |
274 | 274 | *baseline_images*, which must correspond else an |
275 | 275 | ImageComparisonFailure exception will be raised. |
276 | 276 |
|
277 | | - Keyword arguments: |
| 277 | + Arguments |
| 278 | + --------- |
| 279 | + baseline_images : list |
| 280 | + A list of strings specifying the names of the images generated by |
| 281 | + calls to :meth:`matplotlib.figure.savefig`. |
278 | 282 |
|
279 | | - *baseline_images*: list |
280 | | - A list of strings specifying the names of the images generated |
281 | | - by calls to :meth:`matplotlib.figure.savefig`. |
282 | | -
|
283 | | - *extensions*: [ None | list ] |
284 | | -
|
285 | | - If *None*, default to all supported extensions. |
| 283 | + extensions : [ None | list ] |
286 | 284 |
|
| 285 | + If None, defaults to all supported extensions. |
287 | 286 | Otherwise, a list of extensions to test. For example ['png','pdf']. |
288 | 287 |
|
289 | | - *tol*: (default 0) |
| 288 | + tol : float, optional, default: 0 |
290 | 289 | The RMS threshold above which the test is considered failed. |
291 | 290 |
|
292 | | - *freetype_version*: str or tuple |
293 | | - The expected freetype version or range of versions for this |
294 | | - test to pass. |
| 291 | + freetype_version : str or tuple |
| 292 | + The expected freetype version or range of versions for this test to |
| 293 | + pass. |
295 | 294 |
|
296 | | - *remove_text*: bool |
297 | | - Remove the title and tick text from the figure before |
298 | | - comparison. This does not remove other, more deliberate, |
299 | | - text, such as legends and annotations. |
| 295 | + remove_text : bool |
| 296 | + Remove the title and tick text from the figure before comparison. |
| 297 | + This does not remove other, more deliberate, text, such as legends and |
| 298 | + annotations. |
300 | 299 |
|
301 | | - *savefig_kwarg*: dict |
| 300 | + savefig_kwarg : dict |
302 | 301 | Optional arguments that are passed to the savefig method. |
303 | 302 |
|
304 | | - *style*: string |
305 | | - Optional name for the base style to apply to the image |
306 | | - test. The test itself can also apply additional styles |
307 | | - if desired. Defaults to the 'classic' style. |
| 303 | + style : string |
| 304 | + Optional name for the base style to apply to the image test. The test |
| 305 | + itself can also apply additional styles if desired. Defaults to the |
| 306 | + '_classic_test' style. |
308 | 307 |
|
309 | 308 | """ |
310 | 309 | if baseline_images is None: |
|
0 commit comments