Skip to content

Commit be65117

Browse files
authored
improve forecast test reliability (#303)
* put conda-forge first in fx builds * add pytest timeout * add skip windows * update whatsnew
1 parent 9a120dd commit be65117

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

ci/requirements-py27.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: test_env
22
channels:
3+
- conda-forge
34
- defaults
4-
- http://conda.anaconda.org/conda-forge
55
dependencies:
66
- python=2.7
77
- numpy
@@ -16,3 +16,4 @@ dependencies:
1616
- nose
1717
- pip:
1818
- coveralls
19+
- pytest-timeout

ci/requirements-py34.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: test_env
22
channels:
3-
- defaults
43
- conda-forge
4+
- defaults
55
dependencies:
66
- python=3.4
77
- numpy
@@ -16,3 +16,4 @@ dependencies:
1616
- nose
1717
- pip:
1818
- coveralls
19+
- pytest-timeout

ci/requirements-py35.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: test_env
22
channels:
3-
- defaults
43
- conda-forge
4+
- defaults
55
dependencies:
66
- python=3.5
77
- numpy
@@ -16,3 +16,4 @@ dependencies:
1616
- nose
1717
- pip:
1818
- coveralls
19+
- pytest-timeout

docs/sphinx/source/whatsnew/v0.4.4.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ Documentation
1818
* Fixes broken Classes link in the v0.3.0 documentation.
1919

2020

21+
Bug fixes
22+
~~~~~~~~~
23+
24+
* Resolved several issues with the forecast module tests. Library import
25+
errors were resolved by prioritizing the conda-forge channel over the
26+
default channel. Stalled ci runs were resolved by adding a timeout to
27+
the HRRR_ESRL test. (:issue:`293`)
28+
29+
2130
Contributors
2231
~~~~~~~~~~~~
2332

pvlib/test/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import pytest
88

99

10+
skip_windows = pytest.mark.skipif('win' in sys.platform,
11+
reason='does not run on windows')
12+
1013
try:
1114
import scipy
1215
has_scipy = True

pvlib/test/test_forecast.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010
from numpy.testing import assert_allclose
1111

12-
from conftest import requires_siphon, has_siphon
12+
from conftest import requires_siphon, has_siphon, skip_windows
1313

1414
pytestmark = pytest.mark.skipif(not has_siphon, reason='requires siphon')
1515

@@ -30,7 +30,10 @@
3030
_end = _start + pd.Timedelta(days=1)
3131
_modelclasses = [
3232
GFS, NAM, HRRR, NDFD, RAP,
33-
pytest.mark.xfail(HRRR_ESRL, reason="HRRR_ESRL is unreliable")]
33+
skip_windows(
34+
pytest.mark.xfail(
35+
pytest.mark.timeout(HRRR_ESRL, timeout=60),
36+
reason="HRRR_ESRL is unreliable"))]
3437
_working_models = []
3538
_variables = ['temp_air', 'wind_speed', 'total_clouds', 'low_clouds',
3639
'mid_clouds', 'high_clouds', 'dni', 'dhi', 'ghi',]

0 commit comments

Comments
 (0)