|
5 | 5 | import datetime |
6 | 6 |
|
7 | 7 | import pytest |
| 8 | +from packaging.version import Version |
8 | 9 | from pygmt import Figure |
| 10 | +from pygmt.clib import __gmt_version__ |
9 | 11 | from pygmt.exceptions import GMTParameterError, GMTValueError |
10 | 12 | from pygmt.params import Axis |
11 | 13 |
|
12 | 14 |
|
| 15 | +# TODO(GMT>6.6.0): Remove the xfail marker. |
| 16 | +@pytest.mark.xfail( |
| 17 | + condition=Version(__gmt_version__) <= Version("6.6.0"), |
| 18 | + reason="Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8938", |
| 19 | +) |
13 | 20 | @pytest.mark.mpl_image_compare |
14 | 21 | def test_solar_terminators(): |
15 | 22 | """ |
16 | 23 | Test passing the solar argument with a time string and no terminator type to confirm |
17 | 24 | the default terminator type. |
18 | 25 | """ |
| 26 | + dt = "1990-02-17 04:25:00" |
19 | 27 | fig = Figure() |
20 | 28 | fig.basemap(region="d", projection="W0/15c", frame=Axis(annot=True)) |
21 | | - fig.solar( |
22 | | - terminator="d", |
23 | | - pen="1p,blue", |
24 | | - terminator_datetime="1990-02-17 04:25:00", |
25 | | - ) |
26 | | - fig.solar( |
27 | | - terminator="a", |
28 | | - pen="1p,red", |
29 | | - terminator_datetime="1990-02-17 04:25:00", |
30 | | - ) |
31 | | - fig.solar( |
32 | | - terminator="c", |
33 | | - pen="1p,green", |
34 | | - terminator_datetime="1990-02-17 04:25:00", |
35 | | - ) |
36 | | - fig.solar( |
37 | | - terminator="n", |
38 | | - pen="1p,yellow", |
39 | | - terminator_datetime="1990-02-17 04:25:00", |
40 | | - ) |
| 29 | + fig.solar(terminator="day_night", pen="1p,blue", terminator_datetime=dt) |
| 30 | + fig.solar(terminator="astronomical", pen="1p,red", terminator_datetime=dt) |
| 31 | + fig.solar(terminator="civil", pen="1p,green", terminator_datetime=dt) |
| 32 | + fig.solar(terminator="nautical", pen="1p,yellow", terminator_datetime=dt) |
41 | 33 | return fig |
42 | 34 |
|
43 | 35 |
|
|
0 commit comments