TST: Clean output from tests by removing warnings (#813)

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
This commit is contained in:
Geir Arne HjelleandJoris Van den Bossche authored and Joris Van den Bossche committed 2018-09-01 13:22:33 +02:00
1 parent 69186cf7c8
commit bf6c5a4e46
3 files changed
+10 -4

No files matched your search

-1
View File
@@ -64,7 +64,6 @@ class TestGeomMethods:
self.g5 = GeoSeries([self.l1, self.l2])
self.g6 = GeoSeries([self.p0, self.t3])
self.empty = GeoSeries([])
self.empty.crs = {'init': 'epsg:4326', 'no_defs': True}
self.empty_poly = Polygon()
# Crossed lines
+4 -2
View File
@@ -400,8 +400,10 @@ class TestPySALPlotting:
cls.df['NEGATIVES'] = np.linspace(-10, 10, len(cls.df.index))
def test_legend(self):
ax = self.df.plot(column='CRIME', scheme='QUANTILES', k=3,
cmap='OrRd', legend=True)
with warnings.catch_warnings(record=True) as _: # don't print warning
# warning coming from pysal / scipy.stats
ax = self.df.plot(column='CRIME', scheme='QUANTILES', k=3,
cmap='OrRd', legend=True)
labels = [t.get_text() for t in ax.get_legend().get_texts()]
expected = [u'0.18 - 26.07', u'26.07 - 41.97', u'41.97 - 68.89']
assert labels == expected
+6 -1
View File
@@ -1,5 +1,7 @@
from __future__ import absolute_import
import warnings
from pandas import Series, DataFrame
from shapely.geometry import Point
@@ -42,7 +44,10 @@ class TestSeries:
assert type(self.pts.take(list(range(0, self.N, 2)))) is GeoSeries
def test_select(self):
assert type(self.pts.select(lambda x: x % 2 == 0)) is GeoSeries
with warnings.catch_warnings(record=True) as _:
# depending on pandas version this raises FutureWarning ->
# suppress it
assert type(self.pts.select(lambda x: x % 2 == 0)) is GeoSeries
def test_groupby(self):
for f, s in self.pts.groupby(lambda x: x % 2):