Skip to content

Commit e18da0e

Browse files
committed
TST: closes (GH5778), failing tests on non-little endian for stata (sparc)
1 parent 4952858 commit e18da0e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pandas/io/tests/test_stata.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
from pandas.util.misc import is_little_endian
1515
from pandas import compat
1616

17+
def skip_if_not_little_endian():
18+
if not is_little_endian():
19+
raise nose.SkipTest("known failure of test on non-little endian")
20+
1721
class TestStata(tm.TestCase):
1822

1923
def setUp(self):
@@ -145,9 +149,7 @@ def test_read_dta4(self):
145149
tm.assert_frame_equal(parsed_13, expected)
146150

147151
def test_read_write_dta5(self):
148-
if not is_little_endian():
149-
raise nose.SkipTest("known failure of test_write_dta5 on "
150-
"non-little endian")
152+
skip_if_not_little_endian()
151153

152154
original = DataFrame([(np.nan, np.nan, np.nan, np.nan, np.nan)],
153155
columns=['float_miss', 'double_miss', 'byte_miss',
@@ -161,9 +163,7 @@ def test_read_write_dta5(self):
161163
original)
162164

163165
def test_write_dta6(self):
164-
if not is_little_endian():
165-
raise nose.SkipTest("known failure of test_write_dta6 on "
166-
"non-little endian")
166+
skip_if_not_little_endian()
167167

168168
original = self.read_csv(self.csv3)
169169
original.index.name = 'index'
@@ -193,9 +193,7 @@ def test_read_dta9(self):
193193
tm.assert_frame_equal(parsed, expected)
194194

195195
def test_read_write_dta10(self):
196-
if not is_little_endian():
197-
raise nose.SkipTest("known failure of test_write_dta10 on "
198-
"non-little endian")
196+
skip_if_not_little_endian()
199197

200198
original = DataFrame(data=[["string", "object", 1, 1.1,
201199
np.datetime64('2003-12-25')]],
@@ -232,6 +230,8 @@ def test_encoding(self):
232230
self.assert_(isinstance(result, unicode))
233231

234232
def test_read_write_dta11(self):
233+
skip_if_not_little_endian()
234+
235235
original = DataFrame([(1, 2, 3, 4)],
236236
columns=['good', compat.u('b\u00E4d'), '8number', 'astringwithmorethan32characters______'])
237237
formatted = DataFrame([(1, 2, 3, 4)],
@@ -248,6 +248,8 @@ def test_read_write_dta11(self):
248248
tm.assert_frame_equal(written_and_read_again.set_index('index'), formatted)
249249

250250
def test_read_write_dta12(self):
251+
skip_if_not_little_endian()
252+
251253
original = DataFrame([(1, 2, 3, 4)],
252254
columns=['astringwithmorethan32characters_1', 'astringwithmorethan32characters_2', '+', '-'])
253255
formatted = DataFrame([(1, 2, 3, 4)],

0 commit comments

Comments
 (0)