diff --git a/odo/backends/tests/test_dask_dataframe.py b/odo/backends/tests/test_dask_dataframe.py index de44c234..3c2daf93 100644 --- a/odo/backends/tests/test_dask_dataframe.py +++ b/odo/backends/tests/test_dask_dataframe.py @@ -17,7 +17,7 @@ def test_discover(): df = pd.DataFrame({'x': list('a'*5 + 'b'*5 + 'c'*5), - 'y': range(15), + 'y': np.arange(15, dtype=np.int64), 'z': list(map(float, range(15)))}, columns=['x', 'y', 'z']) df.x = df.x.astype('category') diff --git a/odo/backends/tests/test_pandas.py b/odo/backends/tests/test_pandas.py index 4b039a0b..9b1aa1eb 100644 --- a/odo/backends/tests/test_pandas.py +++ b/odo/backends/tests/test_pandas.py @@ -75,7 +75,8 @@ def test_timedelta_to_pandas(): def test_categorical_pandas(): df = pd.DataFrame({'x': list('a'*5 + 'b'*5 + 'c'*5), - 'y': range(15)}, columns=['x', 'y']) + 'y': np.arange(15, dtype=np.int64)}, + columns=['x', 'y']) df.x = df.x.astype('category') assert_dshape_equal(discover(df), 15 * Record([('x', Categorical(['a', 'b', 'c'])), ('y', int64)])) diff --git a/odo/backends/tests/test_postgres.py b/odo/backends/tests/test_postgres.py index abb6ec66..30ec6d94 100644 --- a/odo/backends/tests/test_postgres.py +++ b/odo/backends/tests/test_postgres.py @@ -17,11 +17,13 @@ from odo import odo, into, resource, drop, discover, convert from odo.utils import assert_allclose, tmpfile +@pytest.fixture(scope='module') +def pg_ip(): + return os.environ.get('POSTGRES_IP', 'localhost') skip_no_rw_loc = \ - pytest.mark.skipif(sys.platform == 'win32' and os.environ.get('POSTGRES_TMP_DIR') is None, - reason=("Requires a read/write location defined by " - "env var POSTGRES_TMP_DIR")) + pytest.mark.skipif(pg_ip() != 'localhost', + reason=("Skipping tests with remote PG server (%s)" % pg_ip())) names = ('tbl%d' % i for i in itertools.count()) new_schema = object() @@ -61,11 +63,6 @@ def complex_csv(tmpdir): yield CSV(fn, has_header=True) -@pytest.fixture(scope='module') -def pg_ip(): - return os.environ.get('POSTGRES_IP', 'localhost') - - @pytest.fixture def url(pg_ip): return 'postgresql://postgres@{}/test::{}'.format(pg_ip, next(names)) diff --git a/odo/backends/tests/test_sqlite.py b/odo/backends/tests/test_sqlite.py index 0b6120b8..a07175fe 100644 --- a/odo/backends/tests/test_sqlite.py +++ b/odo/backends/tests/test_sqlite.py @@ -1,6 +1,7 @@ from __future__ import absolute_import, division, print_function import os +import sys from platform import platform from itertools import product import pytest @@ -84,7 +85,8 @@ def test_different_encoding(): 'sqlite:///%s::t' % db, encoding=encoding) result = odo(sql, list) - NULL = u'' if 'windows' not in platform().lower() else None + NULL = u'' + expected = [(u'1958.001.500131-1A', 1, NULL, NULL, 899), (u'1958.001.500156-6', 1, NULL, NULL, 899), (u'1958.001.500162-1', 1, NULL, NULL, 899),