Skip to content

Commit 0efd52b

Browse files
committed
TST: skip buggy parsing test on win-64
1 parent 384eb45 commit 0efd52b

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

pandas/io/tests/test_cparser.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,30 @@ def test_header_not_enough_lines(self):
186186
'1,2,3\n'
187187
'4,5,6')
188188

189+
reader = TextReader(StringIO(data), delimiter=',', header=2)
190+
header = reader.header
191+
expected = [['a', 'b', 'c']]
192+
self.assertEqual(header, expected)
193+
194+
recs = reader.read()
195+
expected = {0 : [1, 4], 1 : [2, 5], 2 : [3, 6]}
196+
assert_array_dicts_equal(expected, recs)
197+
198+
# not enough rows
199+
self.assertRaises(parser.CParserError, TextReader, StringIO(data),
200+
delimiter=',', header=5, as_recarray=True)
201+
202+
def test_header_not_enough_lines_as_recarray(self):
203+
204+
if compat.is_platform_windows():
205+
raise nose.SkipTest("segfaults on win-64, only when all tests are run")
206+
207+
data = ('skip this\n'
208+
'skip this\n'
209+
'a,b,c\n'
210+
'1,2,3\n'
211+
'4,5,6')
212+
189213
reader = TextReader(StringIO(data), delimiter=',', header=2,
190214
as_recarray=True)
191215
header = reader.header
@@ -246,6 +270,21 @@ def _make_reader(**kwds):
246270
self.assertTrue((result[0] == ex_values).all())
247271
self.assertEqual(result[1].dtype, 'S4')
248272

273+
def test_numpy_string_dtype_as_recarray(self):
274+
data = """\
275+
a,1
276+
aa,2
277+
aaa,3
278+
aaaa,4
279+
aaaaa,5"""
280+
281+
if compat.is_platform_windows():
282+
raise nose.SkipTest("segfaults on win-64, only when all tests are run")
283+
284+
def _make_reader(**kwds):
285+
return TextReader(StringIO(data), delimiter=',', header=None,
286+
**kwds)
287+
249288
reader = _make_reader(dtype='S4', as_recarray=True)
250289
result = reader.read()
251290
self.assertEqual(result['0'].dtype, 'S4')

pandas/io/tests/test_parsers.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,9 @@ def read_table(self, *args, **kwds):
32043204
return read_table(*args, **kwds)
32053205

32063206
def test_compact_ints(self):
3207+
if compat.is_platform_windows():
3208+
raise nose.SkipTest("segfaults on win-64, only when all tests are run")
3209+
32073210
data = ('0,1,0,0\n'
32083211
'1,1,0,0\n'
32093212
'0,1,0,1')
@@ -3515,6 +3518,25 @@ def test_compact_ints(self):
35153518
'1,1,0,0\n'
35163519
'0,1,0,1')
35173520

3521+
result = read_csv(StringIO(data), delimiter=',', header=None,
3522+
compact_ints=True)
3523+
ex_dtype = np.dtype([(str(i), 'i1') for i in range(4)])
3524+
self.assertEqual(result.to_records(index=False).dtype, ex_dtype)
3525+
3526+
result = read_csv(StringIO(data), delimiter=',', header=None,
3527+
compact_ints=True,
3528+
use_unsigned=True)
3529+
ex_dtype = np.dtype([(str(i), 'u1') for i in range(4)])
3530+
self.assertEqual(result.to_records(index=False).dtype, ex_dtype)
3531+
3532+
def test_compact_ints_as_recarray(self):
3533+
if compat.is_platform_windows():
3534+
raise nose.SkipTest("segfaults on win-64, only when all tests are run")
3535+
3536+
data = ('0,1,0,0\n'
3537+
'1,1,0,0\n'
3538+
'0,1,0,1')
3539+
35183540
result = read_csv(StringIO(data), delimiter=',', header=None,
35193541
compact_ints=True, as_recarray=True)
35203542
ex_dtype = np.dtype([(str(i), 'i1') for i in range(4)])
@@ -3554,6 +3576,21 @@ def test_pass_dtype(self):
35543576
3,4.5
35553577
4,5.5"""
35563578

3579+
result = self.read_csv(StringIO(data), dtype={'one': 'u1', 1: 'S1'})
3580+
self.assertEqual(result['one'].dtype, 'u1')
3581+
self.assertEqual(result['two'].dtype, 'object')
3582+
3583+
def test_pass_dtype_as_recarray(self):
3584+
data = """\
3585+
one,two
3586+
1,2.5
3587+
2,3.5
3588+
3,4.5
3589+
4,5.5"""
3590+
3591+
if compat.is_platform_windows():
3592+
raise nose.SkipTest("segfaults on win-64, only when all tests are run")
3593+
35573594
result = self.read_csv(StringIO(data), dtype={'one': 'u1', 1: 'S1'},
35583595
as_recarray=True)
35593596
self.assertEqual(result['one'].dtype, 'u1')
@@ -3623,6 +3660,7 @@ def test_usecols_dtypes(self):
36233660
4,5,6
36243661
7,8,9
36253662
10,11,12"""
3663+
36263664
result = self.read_csv(StringIO(data), usecols=(0, 1, 2),
36273665
names=('a', 'b', 'c'),
36283666
header=None,

pandas/sparse/tests/test_libsparse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pandas.util.testing as tm
99

1010
from pandas.core.sparse import SparseSeries
11-
from pandas import DataFrame
11+
from pandas import DataFrame, compat
1212

1313
from pandas._sparse import IntIndex, BlockIndex
1414
import pandas._sparse as splib
@@ -230,6 +230,8 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
230230
_check_length_exc(xindex.to_int_index(),
231231
longer_index.to_int_index())
232232

233+
if compat.is_platform_windows():
234+
raise nose.SkipTest("segfaults on win-64 when all tests are run")
233235
check_cases(_check_case)
234236

235237

0 commit comments

Comments
 (0)