Skip to content

Commit

Permalink
Merge pull request #419 from kwmsmith/bugfix/sqlite-null-on-windows
Browse files Browse the repository at this point in the history
Fix various windows tests for release.
  • Loading branch information
kwmsmith committed Feb 3, 2016
2 parents ed89016 + 7f79471 commit b4ddd94
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion odo/backends/tests/test_dask_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion odo/backends/tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]))
Expand Down
13 changes: 5 additions & 8 deletions odo/backends/tests/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion odo/backends/tests/test_sqlite.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit b4ddd94

Please sign in to comment.