@pytest.mark.parametrize('parallel', [True, False])
def test_strip_line_trailing_whitespace(parallel, read_basic):
 text = 'a b c\n1 2 \n3 4 5'
 with pytest.raises(CParserError) as e:
  ascii.read(StringIO(text), format='fast_basic', guess=False)
 assert ('not enough columns found in line 1' in str(e))
 text = 'a b c\n 1 2 3    DCTB  \n 4 5 6 '
 table = read_basic(text, parallel=parallel)
 expected = Table([[1, 4], [2, 5], [3, 6]], names=('a', 'b', 'c'))
 assert_table_equal(table, expected)

@ pytest . mark . parametrize ( 'parallel' , [ True , False ] ) def test_strip_line_trailing_whitespace ( parallel , read_basic ) : text = 'a b c\n1 2 \n3 4 5' with pytest . raises ( CParserError ) as e : ascii . read ( StringIO ( text ) , format = 'fast_basic' , guess = False ) assert ( 'not enough columns found in line 1' in str ( e ) ) text = 'a b c\n 1 2 3    DCTB  \n 4 5 6 ' table = read_basic ( text , parallel = parallel ) expected = Table ( [ [ 1 , 4 ] , [ 2 , 5 ] , [ 3 , 6 ] ] , names = ( 'a' , 'b' , 'c' ) ) assert_table_equal ( table , expected )
readers that strip whitespace from lines should ignore trailing whitespace after the last data value of each row .