11import cartopy .crs as ccrs
22import numpy as np
3+ import pytest
34
45import mplotutils as mpu
56
67from . import subplots_context
78
89
9- def test_yticklabels_robinson ():
10+ @pytest .mark .parametrize ("pass_ax" , (True , False ))
11+ def test_yticklabels_robinson (pass_ax ):
1012 with subplots_context (subplot_kw = dict (projection = ccrs .Robinson ())) as (f , ax ):
1113 ax .set_global ()
1214
1315 lat = np .arange (- 90 , 91 , 20 )
1416
15- mpu .yticklabels (lat , ax = ax , size = 8 )
17+ ax_ = ax if pass_ax else None
18+ mpu .yticklabels (lat , ax = ax_ , size = 8 )
1619
1720 x_pos = - 179.99
1821
@@ -26,14 +29,16 @@ def test_yticklabels_robinson():
2629 assert ax .texts [- 1 ].get_text () == "70°N"
2730
2831
29- def test_yticklabels_robinson_180 ():
32+ @pytest .mark .parametrize ("pass_ax" , (True , False ))
33+ def test_yticklabels_robinson_180 (pass_ax ):
3034 proj = ccrs .Robinson (central_longitude = 180 )
3135 with subplots_context (subplot_kw = dict (projection = proj )) as (f , ax ):
3236 ax .set_global ()
3337
3438 lat = np .arange (- 90 , 91 , 20 )
3539
36- mpu .yticklabels (lat , ax = ax , size = 8 )
40+ ax_ = ax if pass_ax else None
41+ mpu .yticklabels (lat , ax = ax_ , size = 8 )
3742
3843 x_pos = 0.0
3944
0 commit comments