Skip to content

Commit 265d953

Browse files
jrebackKrzysztof Chomski
authored and
Krzysztof Chomski
committed
TST: remove moar warnings (pandas-dev#17872)
1 parent fcc91de commit 265d953

File tree

4 files changed

+17
-45
lines changed

4 files changed

+17
-45
lines changed

pandas/core/dtypes/missing.py

+6
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ def array_equivalent(left, right, strict_nan=False):
327327
left = left.view('i8')
328328
right = right.view('i8')
329329

330+
# if we have structured dtypes, compare first
331+
if (left.dtype.type is np.void or
332+
right.dtype.type is np.void):
333+
if left.dtype != right.dtype:
334+
return False
335+
330336
return np.array_equal(left, right)
331337

332338

pandas/tests/io/test_gbq.py

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def make_mixed_dataframe_v2(test_size):
9292
index=range(test_size))
9393

9494

95-
@pytest.mark.xfail(reason="gbq having issues")
9695
@pytest.mark.single
9796
class TestToGBQIntegrationWithServiceAccountKeyPath(object):
9897

pandas/tests/io/test_pytables.py

+10-43
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
import sys
32
import os
43
import tempfile
54
from contextlib import contextmanager
@@ -16,7 +15,8 @@
1615
date_range, timedelta_range, Index, DatetimeIndex,
1716
isna)
1817

19-
from pandas.compat import is_platform_windows, PY3, PY35, BytesIO, text_type
18+
from pandas.compat import (is_platform_windows, is_platform_little_endian,
19+
PY3, PY35, PY36, BytesIO, text_type)
2020
from pandas.io.formats.printing import pprint_thing
2121
from pandas.core.dtypes.common import is_categorical_dtype
2222

@@ -1042,11 +1042,10 @@ def check(format, index):
10421042
with catch_warnings(record=True):
10431043
check('fixed', index)
10441044

1045+
@pytest.mark.skipif(not is_platform_little_endian(),
1046+
reason="reason platform is not little endian")
10451047
def test_encoding(self):
10461048

1047-
if sys.byteorder != 'little':
1048-
pytest.skip('system byteorder is not little')
1049-
10501049
with ensure_clean_store(self.path) as store:
10511050
df = DataFrame(dict(A='foo', B='bar'), index=range(5))
10521051
df.loc[2, 'A'] = np.nan
@@ -2887,9 +2886,6 @@ def test_index_types(self):
28872886

28882887
def test_timeseries_preepoch(self):
28892888

2890-
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
2891-
pytest.skip("won't work on Python < 2.7")
2892-
28932889
dr = bdate_range('1/1/1940', '1/1/1960')
28942890
ts = Series(np.random.randn(len(dr)), index=dr)
28952891
try:
@@ -4274,13 +4270,11 @@ def test_select_as_multiple(self):
42744270
['df1', 'df3'], where=['A>0', 'B>0'],
42754271
selector='df1')
42764272

4273+
@pytest.mark.skipf(
4274+
LooseVersion(tables.__version__) < '3.1.0',
4275+
"tables version does not support fix for nan selection bug: GH 4858")
42774276
def test_nan_selection_bug_4858(self):
42784277

4279-
# GH 4858; nan selection bug, only works for pytables >= 3.1
4280-
if LooseVersion(tables.__version__) < '3.1.0':
4281-
pytest.skip('tables version does not support fix for nan '
4282-
'selection bug: GH 4858')
4283-
42844278
with ensure_clean_store(self.path) as store:
42854279

42864280
df = DataFrame(dict(cols=range(6), values=range(6)),
@@ -4598,11 +4592,9 @@ def test_pytables_native_read(self):
45984592
d2 = store['detector/readout']
45994593
assert isinstance(d2, DataFrame)
46004594

4595+
@pytest.mark.skipif(PY35 and is_platform_windows(),
4596+
reason="native2 read fails oddly on windows / 3.5")
46014597
def test_pytables_native2_read(self):
4602-
# fails on win/3.5 oddly
4603-
if PY35 and is_platform_windows():
4604-
pytest.skip("native2 read fails oddly on windows / 3.5")
4605-
46064598
with ensure_clean_store(
46074599
tm.get_data_path('legacy_hdf/pytables_native2.h5'),
46084600
mode='r') as store:
@@ -4690,31 +4682,6 @@ def do_copy(f, new_f=None, keys=None,
46904682
finally:
46914683
safe_remove(path)
46924684

4693-
def test_legacy_table_write(self):
4694-
pytest.skip("cannot write legacy tables")
4695-
4696-
store = HDFStore(tm.get_data_path(
4697-
'legacy_hdf/legacy_table_%s.h5' % pandas.__version__), 'a')
4698-
4699-
df = tm.makeDataFrame()
4700-
with catch_warnings(record=True):
4701-
wp = tm.makePanel()
4702-
4703-
index = MultiIndex(levels=[['foo', 'bar', 'baz', 'qux'],
4704-
['one', 'two', 'three']],
4705-
labels=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3],
4706-
[0, 1, 2, 0, 1, 1, 2, 0, 1, 2]],
4707-
names=['foo', 'bar'])
4708-
df = DataFrame(np.random.randn(10, 3), index=index,
4709-
columns=['A', 'B', 'C'])
4710-
store.append('mi', df)
4711-
4712-
df = DataFrame(dict(A='foo', B='bar'), index=lrange(10))
4713-
store.append('df', df, data_columns=['B'], min_itemsize={'A': 200})
4714-
store.append('wp', wp)
4715-
4716-
store.close()
4717-
47184685
def test_store_datetime_fractional_secs(self):
47194686

47204687
with ensure_clean_store(self.path) as store:
@@ -5260,7 +5227,7 @@ def test_read_hdf_series_mode_r(self, format):
52605227
result = pd.read_hdf(path, key='data', mode='r')
52615228
tm.assert_series_equal(result, series)
52625229

5263-
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Need python 3.6")
5230+
@pytest.mark.skipif(not PY36, reason="Need python 3.6")
52645231
def test_fspath(self):
52655232
with tm.ensure_clean('foo.h5') as path:
52665233
with pd.HDFStore(path) as store:

pandas/tests/test_algos.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ def test_duplicated_with_nas(self):
765765
2, 4, 1, 5, 6]),
766766
np.array([1.1, 2.2, 1.1, np.nan, 3.3,
767767
2.2, 4.4, 1.1, np.nan, 6.6]),
768-
pytest.mark.xfail(resaon="Complex bug. GH 16399")(
768+
pytest.mark.xfail(reason="Complex bug. GH 16399")(
769769
np.array([1 + 1j, 2 + 2j, 1 + 1j, 5 + 5j, 3 + 3j,
770770
2 + 2j, 4 + 4j, 1 + 1j, 5 + 5j, 6 + 6j])
771771
),

0 commit comments

Comments
 (0)