14
14
from pandas .io .stata import read_stata , StataReader , StataWriter
15
15
import pandas .util .testing as tm
16
16
from pandas .util .testing import ensure_clean
17
-
18
- def _skip_if_not_little (name ):
19
- if sys .byteorder != 'little' :
20
- raise nose .SkipTest ('system byteorder is not little, skipping %s' % name )
17
+ from pandas .util .decorators import knownfailureif
18
+ from pandas .util .misc import is_little_endian
21
19
22
20
class StataTests (unittest .TestCase ):
23
21
@@ -131,8 +129,8 @@ def test_read_dta4(self):
131
129
132
130
tm .assert_frame_equal (parsed , expected )
133
131
132
+ @knownfailureif (not is_little_endian (), "known failure of test_write_dta5 on non-little endian" )
134
133
def test_write_dta5 (self ):
135
- _skip_if_not_little ('write_dta5' )
136
134
original = DataFrame ([(np .nan , np .nan , np .nan , np .nan , np .nan )],
137
135
columns = ['float_miss' , 'double_miss' , 'byte_miss' , 'int_miss' , 'long_miss' ])
138
136
original .index .name = 'index'
@@ -142,8 +140,8 @@ def test_write_dta5(self):
142
140
written_and_read_again = self .read_dta (path )
143
141
tm .assert_frame_equal (written_and_read_again .set_index ('index' ), original )
144
142
143
+ @knownfailureif (not is_little_endian (), "known failure of test_write_dta6 on non-little endian" )
145
144
def test_write_dta6 (self ):
146
- _skip_if_not_little ('write_dta6' )
147
145
original = self .read_csv (self .csv3 )
148
146
original .index .name = 'index'
149
147
0 commit comments