|
24 | 24 | StataReader,
|
25 | 25 | read_stata,
|
26 | 26 | )
|
| 27 | +import platform |
| 28 | +import re |
| 29 | +is_intel=bool(re.match('i.?86|x86',platform.uname()[4])) |
27 | 30 |
|
| 31 | +from pandas.compat import is_platform_little_endian |
| 32 | +pytestmark = pytest.mark.xfail(condition=not is_platform_little_endian(),reason="known failure of test_stata on non-little endian",strict=False) |
28 | 33 |
|
29 | 34 | @pytest.fixture
|
30 | 35 | def dirpath(datapath):
|
@@ -196,7 +201,7 @@ def test_read_dta2(self):
|
196 | 201 | # parsed_113 = self.read_dta(self.dta2_113)
|
197 | 202 |
|
198 | 203 | # Remove resource warnings
|
199 |
| - w = [x for x in w if x.category is UserWarning] |
| 204 | + w = [x for x in w if x.category is UserWarning and not "Non-x86 system detected" in str(x.message)] |
200 | 205 |
|
201 | 206 | # should get warning for each call to read_dta
|
202 | 207 | assert len(w) == 3
|
@@ -453,7 +458,7 @@ def test_read_write_dta12(self, version):
|
453 | 458 | warnings.simplefilter("always", InvalidColumnName)
|
454 | 459 | original.to_stata(path, None, version=version)
|
455 | 460 | # should get a warning for that format.
|
456 |
| - assert len(w) == 1 |
| 461 | + assert len([x for x in w if not "Non-x86 system detected" in str(x.message)]) == 1 |
457 | 462 |
|
458 | 463 | written_and_read_again = self.read_dta(path)
|
459 | 464 | tm.assert_frame_equal(written_and_read_again.set_index("index"), formatted)
|
@@ -496,6 +501,7 @@ def test_read_write_reread_dta14(self, file, parsed_114, version):
|
496 | 501 | written_and_read_again = self.read_dta(path)
|
497 | 502 | tm.assert_frame_equal(written_and_read_again.set_index("index"), parsed_114)
|
498 | 503 |
|
| 504 | + @pytest.mark.xfail(condition=not is_intel,reason="https://bugs.debian.org/877419",strict=False) |
499 | 505 | @pytest.mark.parametrize(
|
500 | 506 | "file", ["dta15_113", "dta15_114", "dta15_115", "dta15_117"]
|
501 | 507 | )
|
@@ -1264,6 +1270,7 @@ def test_write_variable_labels(self, version):
|
1264 | 1270 | read_labels = sr.variable_labels()
|
1265 | 1271 | assert read_labels == variable_labels
|
1266 | 1272 |
|
| 1273 | + @pytest.mark.xfail(condition=not is_intel,reason="https://bugs.debian.org/877419",strict=False) |
1267 | 1274 | @pytest.mark.parametrize("version", [114, 117])
|
1268 | 1275 | def test_invalid_variable_labels(self, version):
|
1269 | 1276 | original = pd.DataFrame(
|
@@ -1330,6 +1337,7 @@ def test_write_variable_label_errors(self):
|
1330 | 1337 | with tm.ensure_clean() as path:
|
1331 | 1338 | original.to_stata(path, variable_labels=variable_labels_long)
|
1332 | 1339 |
|
| 1340 | + @pytest.mark.xfail(condition=not is_intel,reason="https://bugs.debian.org/877419",strict=False) |
1333 | 1341 | def test_default_date_conversion(self):
|
1334 | 1342 | # GH 12259
|
1335 | 1343 | dates = [
|
@@ -1775,8 +1783,9 @@ def test_encoding_latin1_118(self):
|
1775 | 1783 | the string values returned are correct."""
|
1776 | 1784 | with tm.assert_produces_warning(UnicodeWarning) as w:
|
1777 | 1785 | encoded = read_stata(self.dta_encoding_118)
|
1778 |
| - assert len(w) == 151 |
1779 |
| - assert w[0].message.args[0] == msg |
| 1786 | + w2 = [x for x in w if not "Non-x86 system detected" in str(x.message)] |
| 1787 | + assert len(w2) == 151 |
| 1788 | + assert w2[0].message.args[0] == msg |
1780 | 1789 |
|
1781 | 1790 | expected = pd.DataFrame([["Düsseldorf"]] * 151, columns=["kreis1849"])
|
1782 | 1791 | tm.assert_frame_equal(encoded, expected)
|
0 commit comments