Skip to content

Commit

Permalink
Merge pull request #1251 from cpcloud/win-34-pytables-test-ignore
Browse files Browse the repository at this point in the history
Skip on win32 py34 pass on mac
  • Loading branch information
cpcloud committed Sep 15, 2015
2 parents fa67e42 + 440454e commit 739104a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 17 additions & 8 deletions blaze/tests/test_interactive.py
Expand Up @@ -9,7 +9,6 @@
from blaze.expr import symbol
from datashape import dshape
from blaze.utils import tmpfile, example
from blaze.compatibility import xfail
import pytest
import sys
from types import MethodType
Expand All @@ -31,10 +30,11 @@

x = np.ones((2, 2))


def test_table_raises_on_inconsistent_inputs():
with pytest.raises(ValueError):
t = Data(data, schema='{name: string, amount: float32}',
dshape=dshape("{name: string, amount: float32}"))
dshape=dshape("{name: string, amount: float32}"))


def test_resources():
Expand Down Expand Up @@ -96,9 +96,11 @@ def test_repr():

def test_str_does_not_repr():
# see GH issue #1240.
d = Data([('aa', 1), ('b', 2)], name="ZZZ", dshape='2 * {a: string, b: int64}')
d = Data([('aa', 1), ('b', 2)], name="ZZZ",
dshape='2 * {a: string, b: int64}')
expr = transform(d, c=d.a.strlen() + d.b)
assert str(expr) == "Merge(_child=ZZZ, children=(ZZZ, label(strlen(_child=ZZZ.a) + ZZZ.b, 'c')))"
assert str(
expr) == "Merge(_child=ZZZ, children=(ZZZ, label(strlen(_child=ZZZ.a) + ZZZ.b, 'c')))"


def test_repr_of_scalar():
Expand Down Expand Up @@ -148,6 +150,7 @@ def test_to_html():

assert to_html(t.count()) == '2'


def test_to_html_on_arrays():
s = to_html(Data(np.ones((2, 2))))
assert '1' in s
Expand Down Expand Up @@ -213,7 +216,7 @@ def test_into_nd_array_column_failure():
def test_Data_attribute_repr():
t = Data(CSV(example('accounts-datetimes.csv')))
result = t.when.day
expected = pd.DataFrame({'when_day': [1,2,3,4,5]})
expected = pd.DataFrame({'when_day': [1, 2, 3, 4, 5]})
assert repr(result) == repr(expected)


Expand All @@ -224,6 +227,7 @@ def test_can_trivially_create_csv_Data():
with Data(example('iris.csv')) as d:
assert d is not None


def test_can_trivially_create_csv_Data_with_unicode():
if sys.version[0] == '2':
assert isinstance(Data(example(u'iris.csv')).data, CSV)
Expand All @@ -237,7 +241,10 @@ def test_can_trivially_create_sqlite_table():
with Data('sqlite:///'+example('iris.db')+'::iris') as d:
assert d is not None

@xfail(reason="h5py/pytables mismatch")

@pytest.mark.xfail(sys.platform != 'darwin', reason="h5py/pytables mismatch")
@pytest.mark.skipif(sys.version_info[:2] == (3, 4) and sys.platform == 'win32',
reason='PyTables + Windows + Python 3.4 crashes')
def test_can_trivially_create_pytables():
pytest.importorskip('tables')
with Data(example('accounts.h5')+'::/accounts') as d:
Expand Down Expand Up @@ -314,7 +321,9 @@ def test_iter():
assert list(d + 1) == [2, 2, 2, 2]


@xfail(reason="DataFrame constructor doesn't yet support __array__")
@pytest.mark.xfail(
reason="DataFrame constructor doesn't yet support __array__"
)
def test_DataFrame():
x = np.array([(1, 2), (1., 2.)], dtype=[('a', 'i4'), ('b', 'f4')])
d = Data(x)
Expand All @@ -338,7 +347,7 @@ def test_head_compute():

def test_scalar_sql_compute():
t = into('sqlite:///:memory:::t', data,
dshape=dshape('var * {name: string, amount: int}'))
dshape=dshape('var * {name: string, amount: int}'))
d = Data(t)
assert repr(d.amount.sum()) == '300'

Expand Down
2 changes: 2 additions & 0 deletions docs/source/whatsnew/0.8.3.txt
Expand Up @@ -107,6 +107,8 @@ Bug Fixes
* Fixed a bug where repr was being called on data resources rather than
string, which caused massive slowdowns on largish expressions running
against blaze server (:issue:`1240`, :issue:`1247`).
* Skip a test on Win32 + Python 3.4 and PyTables until this gets sorted out on
the library side (:issue:`1251`).

Miscellaneous
~~~~~~~~~~~~~
Expand Down

0 comments on commit 739104a

Please sign in to comment.