Skip to content

Commit 9480c3c

Browse files
committed
Merge pull request #7266 from jreback/sparc_fixes3
TST: disable stata tests on big-endian (GH5781) / fix datetime64[ns] comparison on big-endian (GH7265)
2 parents 77c6f0e + 247a611 commit 9480c3c

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

pandas/io/tests/test_stata.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
from pandas.util.misc import is_little_endian
2020
from pandas import compat
2121

22-
def skip_if_not_little_endian():
23-
if not is_little_endian():
24-
raise nose.SkipTest("known failure of test on non-little endian")
22+
if not is_little_endian():
23+
raise nose.SkipTest("known failure of test_stata on non-little endian")
2524

2625
class TestStata(tm.TestCase):
2726

@@ -198,8 +197,6 @@ def test_read_dta4(self):
198197
tm.assert_frame_equal(parsed_117, expected)
199198

200199
def test_read_write_dta5(self):
201-
# skip_if_not_little_endian()
202-
203200
original = DataFrame([(np.nan, np.nan, np.nan, np.nan, np.nan)],
204201
columns=['float_miss', 'double_miss', 'byte_miss',
205202
'int_miss', 'long_miss'])
@@ -212,8 +209,6 @@ def test_read_write_dta5(self):
212209
original)
213210

214211
def test_write_dta6(self):
215-
# skip_if_not_little_endian()
216-
217212
original = self.read_csv(self.csv3)
218213
original.index.name = 'index'
219214
original.index = original.index.astype(np.int32)
@@ -245,8 +240,6 @@ def test_read_dta9(self):
245240
tm.assert_frame_equal(parsed, expected)
246241

247242
def test_read_write_dta10(self):
248-
# skip_if_not_little_endian()
249-
250243
original = DataFrame(data=[["string", "object", 1, 1.1,
251244
np.datetime64('2003-12-25')]],
252245
columns=['string', 'object', 'integer', 'floating',
@@ -284,8 +277,6 @@ def test_encoding(self):
284277
self.assertIsInstance(result, unicode)
285278

286279
def test_read_write_dta11(self):
287-
# skip_if_not_little_endian()
288-
289280
original = DataFrame([(1, 2, 3, 4)],
290281
columns=['good', compat.u('b\u00E4d'), '8number', 'astringwithmorethan32characters______'])
291282
formatted = DataFrame([(1, 2, 3, 4)],
@@ -303,8 +294,6 @@ def test_read_write_dta11(self):
303294
tm.assert_frame_equal(written_and_read_again.set_index('index'), formatted)
304295

305296
def test_read_write_dta12(self):
306-
# skip_if_not_little_endian()
307-
308297
original = DataFrame([(1, 2, 3, 4, 5, 6)],
309298
columns=['astringwithmorethan32characters_1',
310299
'astringwithmorethan32characters_2',

pandas/tests/test_base.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ def test_value_counts_unique_nunique(self):
246246
# Unable to assign None
247247
continue
248248

249-
values[0:2] = null_obj
249+
# special assign to the numpy array
250+
if o.values.dtype == 'datetime64[ns]':
251+
values[0:2] = pd.tslib.iNaT
252+
else:
253+
values[0:2] = null_obj
250254

251255
# create repeated values, 'n'th element is repeated by n+1 times
252256
if isinstance(o, PeriodIndex):

0 commit comments

Comments
 (0)