|
33 | 33 | read_stata,
|
34 | 34 | )
|
35 | 35 |
|
| 36 | +from pandas.compat import is_platform_little_endian |
| 37 | +pytestmark = pytest.mark.xfail(condition=not is_platform_little_endian(),reason="known failure of test_stata on non-little endian",strict=False) |
36 | 38 |
|
37 | 39 | @pytest.fixture()
|
38 | 40 | def mixed_frame():
|
@@ -207,7 +209,7 @@ def test_read_dta2(self):
|
207 | 209 | # parsed_113 = self.read_dta(self.dta2_113)
|
208 | 210 |
|
209 | 211 | # Remove resource warnings
|
210 |
| - w = [x for x in w if x.category is UserWarning] |
| 212 | + w = [x for x in w if x.category is UserWarning and not "Non-x86 system detected" in str(x.message)] |
211 | 213 |
|
212 | 214 | # should get warning for each call to read_dta
|
213 | 215 | assert len(w) == 3
|
@@ -469,7 +471,7 @@ def test_read_write_dta12(self, version):
|
469 | 471 | warnings.simplefilter("always", InvalidColumnName)
|
470 | 472 | original.to_stata(path, None, version=version)
|
471 | 473 | # should get a warning for that format.
|
472 |
| - assert len(w) == 1 |
| 474 | + assert len([x for x in w if not "Non-x86 system detected" in str(x.message)]) == 1 |
473 | 475 |
|
474 | 476 | written_and_read_again = self.read_dta(path)
|
475 | 477 | tm.assert_frame_equal(written_and_read_again.set_index("index"), formatted)
|
@@ -1793,8 +1795,9 @@ def test_encoding_latin1_118(self):
|
1793 | 1795 | the string values returned are correct."""
|
1794 | 1796 | with tm.assert_produces_warning(UnicodeWarning) as w:
|
1795 | 1797 | encoded = read_stata(self.dta_encoding_118)
|
1796 |
| - assert len(w) == 151 |
1797 |
| - assert w[0].message.args[0] == msg |
| 1798 | + w2 = [x for x in w if not "Non-x86 system detected" in str(x.message)] |
| 1799 | + assert len(w2) == 151 |
| 1800 | + assert w2[0].message.args[0] == msg |
1798 | 1801 |
|
1799 | 1802 | expected = DataFrame([["Düsseldorf"]] * 151, columns=["kreis1849"])
|
1800 | 1803 | tm.assert_frame_equal(encoded, expected)
|
|
0 commit comments