Reading data from csv file, I keep getting errors

Asked by mr17

I have test case and the csv file , but I keep getting erros while sst is trying to do compile(source, filename, mode, PyCF_ONLY_AST).Are there limitations on how the data in csv should be formated ? This is what my csv file looks like .

Test Event 21770^R5_1^Test Description^855^True^2013-06-20^2014-06-20^02:20 AM^02:20 PM^Rea Automation^4886 Darrel Avenue^Rea^MO^MX^64480^Sponsor^Chloe^<email address hidden>^573-221-9895^^pass^['event_name', 'category', 'cost', 'description']
^R5_1^Test Description^978^False^2013-06-20^2014-06-20^02:20 AM^02:20 PM^Blum Automation^2957 Glen Meadow Circle^Blum^TX^MX^76627^Sponsor^Billie^<email address hidden>^469-816-3558^^fail^['event_name', 'category', 'cost', 'description']
Test Event 21348^^Test Description^649^False^2013-06-20^2014-06-20^02:20 AM^02:20 PM^Dodge Automation^5124 Fleetwood Oaks Drive^Dodge^NE^US^68633^Sponsor^Alan^<email address hidden>^775-456-2287^^fail^['event_name', 'category', 'cost', 'description']

sst-run --with-flags=qa1
starting SST...

  date time: 2013-06-24 11:29
  test directory: '.'
  report format: 'console'
  browser type: 'Firefox'
  shared directory: None
  screenshots on error: False
  failfast: False
  debug: False
  headless xserver: False

  Reading data from 'r5_calendar.csv'... --------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/bin/sst-run", line 8, in <module>
    load_entry_point('sst==0.2.3', 'console_scripts', 'sst-run')()
  File "/Library/Python/2.7/site-packages/sst/scripts/", line 95, in main
  File "/Library/Python/2.7/site-packages/sst/", line 92, in runtests
  File "/Library/Python/2.7/site-packages/sst/", line 207, in get_suites
    and not os.path.split(root)[1].startswith('_')
  File "/Library/Python/2.7/site-packages/sst/", line 247, in get_suite
    for row in get_data(csv_path):
  File "/Library/Python/2.7/site-packages/sst/", line 602, in get_data
    value = ast.literal_eval(field)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 1
    Test Event 21770
SyntaxError: invalid syntax

Question information

English Edit question
selenium-simple-test Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
mr17 (marsel) said :

I realized that ast.literal_eval(field) is trying to evaluate each field and its not returing string all the time like I thought first . I simplyfied dtest data and seems to be working as expected.

Revision history for this message
Corey Goldberg (coreygoldberg) said :

glad you got it working. feel free to post an Issue if you think there is a bug in the csv handling.