Skip to content

Commit 73bacad

Browse files
committed
TST: skip test for test_precise_conversion GH8646
1 parent 7be0236 commit 73bacad

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

pandas/io/tests/test_parsers.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,31 +3049,23 @@ def test_comment_skiprows(self):
30493049
tm.assert_almost_equal(df.values, expected)
30503050

30513051
def test_trailing_spaces(self):
3052-
data = """A B C
3053-
random line with trailing spaces
3054-
skip
3055-
1,2,3
3056-
1,2.,4.
3057-
random line with trailing tabs\t\t\t
3058-
3059-
5.1,NaN,10.0
3060-
"""
3052+
data = "A B C \nrandom line with trailing spaces \nskip\n1,2,3\n1,2.,4.\nrandom line with trailing tabs\t\t\t\n \n5.1,NaN,10.0\n"
30613053
expected = pd.DataFrame([[1., 2., 4.],
30623054
[5.1, np.nan, 10.]])
3063-
# this should ignore six lines including lines with trailing
3055+
# this should ignore six lines including lines with trailing
30643056
# whitespace and blank lines. issues 8661, 8679
3065-
df = self.read_csv(StringIO(data.replace(',', ' ')),
3057+
df = self.read_csv(StringIO(data.replace(',', ' ')),
30663058
header=None, delim_whitespace=True,
30673059
skiprows=[0,1,2,3,5,6], skip_blank_lines=True)
30683060
tm.assert_frame_equal(df, expected)
3069-
df = self.read_table(StringIO(data.replace(',', ' ')),
3061+
df = self.read_table(StringIO(data.replace(',', ' ')),
30703062
header=None, delim_whitespace=True,
30713063
skiprows=[0,1,2,3,5,6], skip_blank_lines=True)
30723064
tm.assert_frame_equal(df, expected)
30733065
# test skipping set of rows after a row with trailing spaces, issue #8983
3074-
expected = pd.DataFrame({"A":[1., 5.1], "B":[2., np.nan],
3066+
expected = pd.DataFrame({"A":[1., 5.1], "B":[2., np.nan],
30753067
"C":[4., 10]})
3076-
df = self.read_table(StringIO(data.replace(',', ' ')),
3068+
df = self.read_table(StringIO(data.replace(',', ' ')),
30773069
delim_whitespace=True,
30783070
skiprows=[1,2,3,5,6], skip_blank_lines=True)
30793071
tm.assert_frame_equal(df, expected)
@@ -3265,6 +3257,7 @@ def test_compact_ints(self):
32653257

32663258
def test_precise_conversion(self):
32673259
# GH #8002
3260+
tm._skip_if_32bit()
32683261
from decimal import Decimal
32693262
normal_errors = []
32703263
precise_errors = []

pandas/util/testing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ def close(fignum=None):
171171
_close(fignum)
172172

173173

174+
def _skip_if_32bit():
175+
import struct
176+
if struct.calcsize("P") * 8 < 64:
177+
raise nose.SkipTest("skipping for 32 bit")
178+
174179
def mplskip(cls):
175180
"""Skip a TestCase instance if matplotlib isn't installed"""
176181

@@ -1761,4 +1766,3 @@ def use_numexpr(use, min_elements=expr._MIN_ELEMENTS):
17611766
for name, obj in inspect.getmembers(sys.modules[__name__]):
17621767
if inspect.isfunction(obj) and name.startswith('assert'):
17631768
setattr(TestCase, name, staticmethod(obj))
1764-

0 commit comments

Comments
 (0)