@pytest.mark.skipif('not HAS_YAML')
def test_csv_ecsv_colnames_mismatch():
 lines = copy.copy(SIMPLE_LINES)
 header_index = lines.index('a b c')
 lines[header_index] = 'a b d'
 with pytest.raises(ValueError) as err:
  ascii.read(lines, format='ecsv')
 assert ("column names from ECSV header ['a', 'b', 'c']" in str(err))

@ pytest . mark . skipif ( 'not HAS_YAML' ) def test_csv_ecsv_colnames_mismatch ( ) : lines = copy . copy ( SIMPLE_LINES ) header_index = lines . index ( 'a b c' ) lines [ header_index ] = 'a b d' with pytest . raises ( ValueError ) as err : ascii . read ( lines , format = 'ecsv' ) assert ( "column names from ECSV header ['a', 'b', 'c']" in str ( err ) )
test that mismatch in column names from normal csv header vs .