Skip to content

Commit

Permalink
TST: Don't try to download shapefiles during import.
Browse files Browse the repository at this point in the history
This breaks pytest test collection if there is no network. Instead,
these tests should fail or be skipped.
  • Loading branch information
QuLogic committed Feb 22, 2018
1 parent 651bbf9 commit 3a56853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/cartopy/tests/test_coastline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import cartopy
import cartopy.io.shapereader as shp

COASTLINE_PATH = shp.natural_earth()


class TestCoastline(object):
def test_robust(self):
COASTLINE_PATH = shp.natural_earth()

# Make sure all the coastlines can be projected without raising any
# exceptions.
projection = cartopy.crs.TransverseMercator(central_longitude=-90)
Expand Down
14 changes: 6 additions & 8 deletions lib/cartopy/tests/test_shapereader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,11 @@
import cartopy.io.shapereader as shp


LAKES_PATH = shp.natural_earth(resolution='110m',
category='physical',
name='lakes')
RIVERS_PATH = shp.natural_earth(resolution='110m',
category='physical',
name='rivers_lake_centerlines')


class TestLakes(object):
def setup_class(self):
LAKES_PATH = shp.natural_earth(resolution='110m',
category='physical',
name='lakes')
self.reader = shp.Reader(LAKES_PATH)
names = [record.attributes['name'] for record in self.reader.records()]
# Choose a nice small lake
Expand Down Expand Up @@ -85,6 +80,9 @@ def test_bounds(self):

class TestRivers(object):
def setup_class(self):
RIVERS_PATH = shp.natural_earth(resolution='110m',
category='physical',
name='rivers_lake_centerlines')
self.reader = shp.Reader(RIVERS_PATH)
names = [record.attributes['name'] for record in self.reader.records()]
# Choose a nice small river
Expand Down

0 comments on commit 3a56853

Please sign in to comment.