astropy/astropy — pull request #2964 by astrofrog (2014-11-02 22:49:22+00:00)
Title: Sporadic test failure with fast io.ascii reader

I'm seeing this test failure from time to time on the Mac Jenkins instance - it's not systematic, so maybe there is a race condition, or something to do with random numbers (haven't checked in detail):

```
def test_fill_include_exclude_names():
"""
fill_include_names and fill_exclude_names should filter missing/empty value handling
in the same way that include_names and exclude_names filter output columns.
"""
text = """
A, B, C
, 1, 2
3, , 4
5, 5,
"""
table = read_csv(text, fill_include_names=['A', 'B'])
assert table['A'][0] is ma.masked
assert table['B'][1] is ma.masked
assert table['C'][2] is not ma.masked # C not in fill_include_names

> table = read_csv(text, fill_exclude_names=['A', 'B'])

astropy/io/ascii/tests/test_c_reader.py:435:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

table = '\nA, B, C\n, 1, 2\n3, , 4\n5, 5,\n'
kwargs = {'fill_exclude_names': ['A', 'B']}

def read_csv(table, **kwargs):
> return _read(table, FastCsv, 'csv', **kwargs)

astropy/io/ascii/tests/test_c_reader.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

table = '\nA, B, C\n, 1, 2\n3, , 4\n5, 5,\n\n'
Reader = , format = 'csv'
fail_parallel = False, kwargs = {'fill_exclude_names': ['A', 'B']}
reader =
t1 =

masked_array(data = [('', '1', 2) ('3', '',...', 'N', 999999),
dtype = [('A', 'S1'), ('B', 'S1'), ('C', '
masked_array(data = [('', '1', 2) ('3', '',...', 'N', 999999),
dtype = [('A', 'S1'), ('B', 'S1'), ('C', '
masked_array(data = [('', '1', 2) ('3', '',...', 'N', 999999),
dtype = [('A', 'S1'), ('B', 'S1'), ('C', '
masked_array(data = [(8070450532247928832, ..., 'N', 999999),
dtype = [('A', '
masked_array(data = [('', '1', 2) ('3', '',...', 'N', 999999),
dtype = [('A', 'S1'), ('B', 'S1'), ('C', ' assert_table_equal(t3, t4)

astropy/io/ascii/tests/test_c_reader.py:55:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

t1 =

masked_array(data = [('', '1', 2) ('3', '',...', 'N', 999999),
dtype = [('A', 'S1'), ('B', 'S1'), ('C', '
masked_array(data = [(8070450532247928832, ..., 'N', 999999),
dtype = [('A', ' assert_equal(t1[name].dtype.kind, t2[name].dtype.kind)

astropy/io/ascii/tests/test_c_reader.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = 'S', b = 'i'

def assert_equal(a, b):
> assert a == b
E assert 'S' == 'i'
E - S
E + i

astropy/io/ascii/tests/common.py:41: AssertionError
```

cc @amras1 @taldcroft