1
+ import os
1
2
import sys
2
3
3
4
import numpy
14
15
from probscale .probscale import _minimal_norm
15
16
16
17
17
- TOLERANCE = 15
18
+ # special toloerance for Github Action CI
19
+ TOLERANCE = int (os .environ .get ("MPL_IMGCOMP_TOLERANCE" , 15 ))
20
+ BASELINE_DIR = "baseline_images/test_probscale"
18
21
19
22
20
23
@pytest .fixture
@@ -132,7 +135,7 @@ def test_sign_with_nan_no_warning(mn):
132
135
133
136
134
137
@pytest .mark .mpl_image_compare (
135
- baseline_dir = "baseline_images/test_probscale" , tolerance = TOLERANCE , remove_text = True
138
+ baseline_dir = BASELINE_DIR , tolerance = TOLERANCE , remove_text = True
136
139
)
137
140
def test_the_scale_default ():
138
141
fig , ax = plt .subplots (figsize = (4 , 8 ))
@@ -142,9 +145,7 @@ def test_the_scale_default():
142
145
return fig
143
146
144
147
145
- @pytest .mark .mpl_image_compare (
146
- baseline_dir = "baseline_images/test_probscale" , tolerance = TOLERANCE
147
- )
148
+ @pytest .mark .mpl_image_compare (baseline_dir = BASELINE_DIR , tolerance = TOLERANCE )
148
149
def test_the_scale_not_as_pct ():
149
150
fig , ax = plt .subplots (figsize = (4 , 8 ))
150
151
ax .set_yscale ("prob" , as_pct = False )
@@ -153,7 +154,7 @@ def test_the_scale_not_as_pct():
153
154
154
155
155
156
@pytest .mark .mpl_image_compare (
156
- baseline_dir = "baseline_images/test_probscale" , tolerance = TOLERANCE , remove_text = True
157
+ baseline_dir = BASELINE_DIR , tolerance = TOLERANCE , remove_text = True
157
158
)
158
159
@pytest .mark .skipif (stats is None , reason = "scipy not installed" )
159
160
def test_the_scale_beta ():
0 commit comments