TST: Skip PostGIS tests for recent pandas master due to SQL API change (GH#98)

This commit is contained in:
Kelsey Jordahl
2014-04-21 07:40:01 -04:00
parent f61a9aa354
commit bddfa20bce
3 changed files with 18 additions and 2 deletions
+5 -1
View File
@@ -13,7 +13,7 @@ from shapely.geometry import Point, Polygon
import fiona
from geopandas import GeoDataFrame, read_file, GeoSeries
from .util import unittest, download_nybb, assert_geoseries_equal, connect, \
create_db, validate_boro_df
create_db, validate_boro_df, PANDAS_NEW_SQL_API
class TestDataFrame(unittest.TestCase):
@@ -363,6 +363,8 @@ class TestDataFrame(unittest.TestCase):
{'a': 2, 'b': np.nan}])
assert_frame_equal(expected, result)
@unittest.skipIf(PANDAS_NEW_SQL_API, 'Development version of pandas '
'not yet supported in SQL API.')
def test_from_postgis_default(self):
con = connect('test_geopandas')
if con is None or not create_db(self.df):
@@ -376,6 +378,8 @@ class TestDataFrame(unittest.TestCase):
validate_boro_df(self, df)
@unittest.skipIf(PANDAS_NEW_SQL_API, 'Development version of pandas '
'not yet supported in SQL API.')
def test_from_postgis_custom_geom_col(self):
con = connect('test_geopandas')
if con is None or not create_db(self.df):
+6 -1
View File
@@ -4,7 +4,8 @@ import fiona
from geopandas import GeoDataFrame, read_postgis, read_file
import tests.util
from .util import unittest
from .util import PANDAS_NEW_SQL_API, unittest
class TestIO(unittest.TestCase):
def setUp(self):
@@ -15,6 +16,8 @@ class TestIO(unittest.TestCase):
with fiona.open(path, vfs=vfs) as f:
self.crs = f.crs
@unittest.skipIf(PANDAS_NEW_SQL_API, 'Development version of pandas '
'not yet supported in SQL API.')
def test_read_postgis_default(self):
con = tests.util.connect('test_geopandas')
if con is None or not tests.util.create_db(self.df):
@@ -28,6 +31,8 @@ class TestIO(unittest.TestCase):
tests.util.validate_boro_df(self, df)
@unittest.skipIf(PANDAS_NEW_SQL_API, 'Development version of pandas '
'not yet supported in SQL API.')
def test_read_postgis_custom_geom_col(self):
con = tests.util.connect('test_geopandas')
if con is None or not tests.util.create_db(self.df):
+7
View File
@@ -22,6 +22,13 @@ except ImportError:
class OperationalError(Exception):
pass
try:
from pandas import read_sql_table
except ImportError:
PANDAS_NEW_SQL_API = False
else:
PANDAS_NEW_SQL_API = True
def download_nybb():
""" Returns the path to the NYC boroughs file. Downloads if necessary. """