Skip to content

Commit

Permalink
Merge pull request pytroll#32 from mitkin/master
Browse files Browse the repository at this point in the history
[tests] Skip deprecation warnings in test_gauss_multi_uncert
  • Loading branch information
mraspaud committed Dec 18, 2015
2 parents a70cd80 + ef341d3 commit fda439a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ before_install:
- sudo apt-get install libfreetype6-dev
- sudo apt-get install libgeos-3.3.8 libgeos-c1 libgeos-dev
install:
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install "matplotlib<1.5.0"; fi
- if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then pip install "matplotlib>=1.5.0"; fi
- if [[ $TRAVIS_PYTHON_VERSION == "3.3" ]]; then pip install "matplotlib<1.5.0"; fi
- if [[ $TRAVIS_PYTHON_VERSION == "3.4" ]]; then pip install "matplotlib>=1.5.0"; fi
- if [[ $TRAVIS_PYTHON_VERSION == "3.5" ]]; then pip install "matplotlib>=1.5.0"; fi
- pip install -r requirements.txt
- pip install -e ".[pykdtree]"
- pip install coveralls
Expand Down
7 changes: 7 additions & 0 deletions pyresample/test/test_kd_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ def test_gauss_multi_uncert(self):
segments=1, with_uncert=True)
else:
with warnings.catch_warnings(record=True) as w:
# The assertion below checks if there is only one warning raised
# and whether it contains a specific message from pyresample
# On python 2.7.9+ the resample_gauss method raises multiple deprecation warnings
# that cause to fail, so we ignore the unrelated warnings.
# TODO: better way would be to filter UserWarning correctly
from numpy import VisibleDeprecationWarning
warnings.simplefilter('ignore', (DeprecationWarning, VisibleDeprecationWarning))
res, stddev, counts = kd_tree.resample_gauss(swath_def, data_multi,
self.area_def, 50000, [
25000, 15000, 10000],
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
git+https://github.com/matplotlib/matplotlib.git
git+https://github.com/matplotlib/basemap.git

0 comments on commit fda439a

Please sign in to comment.