title: python tests using robot framework
body: <p>Does anyone have a good example of testing a python program using Robot Framework.</p>
  <p>I am trying to run my python program (chaptermarkers.py) with an argument of --test and checking the results.</p>
  <p>Passing the argument has been an odyssey of google searches for 2 days.</p>
  <p>[file: common_resourses.robot]</p>
  <pre><code>*** Settings ***
  Library  OperatingSystem
  
  *** Variables ***
  ${CHAPTERMARKERS_EXEC}  chaptermarkers
  ${LOG LEVEL}    DEBUG
  
  *** Keywords ***
  # TODO
  </code></pre>
  <p>[Test Cases: file: default_suite.robot]</p>
  <pre><code>*** Settings ***
  Documentation       *Test Chapter Markers runs but has error in filename*
  Metadata    Github  https://github.com/cbitterfield/chaptermarkers
  Metadata    Version 1.0.0
  Metadata    Executed At    ${HOST}
  
  
  # External libraries imports
  Library  Process
  Library  String
  
  Resource    common_resources.robot
  
  *** Variables ***
  ${EXPECTED_MESSAGE}  Movie Filename
  ${REPORT FILE}  report.html
  ${LOG FILE}     logfile.html
  ${LOG LEVEL}    DEBUG
  ${OUTPUT DIR}   /Users/colin/IdeaProjects/chaptermarkers
  ${test} --test
  
  
  *** Test Cases ***
  
      Scenerio test chaptermarkers run
          [Tags]    DEBUG
          [Documentation]     Verifies that chaptermarkers is executed well and without errors
          ${result}=  Run process     ${CHAPTERMARKERS_EXEC} ${test}
          Should Contain  ${result.stdout}    ${EXPECTED_MESSAGE}
          Should Be Empty     ${result.stderr}
  </code></pre>
  <p>No matter how I try to put something after the program, I get an error of directory missing.</p>
  <p>[Crazy unusable error messages]</p>
  <pre><code>$ robot --loglevel DEBUG --log log.html --report report.html stests/default_suite.robot 
  [ ERROR ] Error in file '/Users/colin/IdeaProjects/chaptermarkers/stests/default_suite.robot' on line 25: Invalid variable name '${test} --test'.
  ==============================================================================
  Default Suite :: *Test Chapter Markers runs but has error in filename*        
  ==============================================================================
  Scenerio test chaptermarkers run :: Verifies that chaptermarkers i... | FAIL |
  Variable '${test}' not found. Did you mean:
      ${TEST_TAGS}
      ${TEST_NAME}
  ------------------------------------------------------------------------------
  Default Suite :: *Test Chapter Markers runs but has error in filen... | PASS |
  0 critical tests, 0 passed, 0 failed
  1 test total, 0 passed, 1 failed
  ==============================================================================
  Output:  /Users/colin/IdeaProjects/chaptermarkers/output.xml
  [ ERROR ] Unexpected error: FileNotFoundError: [Errno 2] No such file or directory: '/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/rebot/log.html'
  Traceback (most recent call last):
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/utils/application.py&quot;, line 83, in _execute
      rc = self.main(arguments, **options)
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/run.py&quot;, line 451, in main
      writer.write_results(settings.get_rebot_settings())
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py&quot;, line 65, in write_results
      self._write_log(results.js_result, settings.log, config)
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py&quot;, line 79, in _write_log
      self._write('Log', LogWriter(js_result).write, path, config)
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py&quot;, line 86, in _write
      writer(path, *args)
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/logreportwriters.py&quot;, line 43, in write
      self._write_file(path, config, LOG)
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/logreportwriters.py&quot;, line 36, in _write_file
      writer.write(template)
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/htmlfilewriter.py&quot;, line 33, in write
      for line in HtmlTemplate(template):
    File &quot;/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/normaltemplate.py&quot;, line 28, in __iter__
      with codecs.open(self._path, encoding='UTF-8') as file:
    File &quot;/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py&quot;, line 905, in open
      file = builtins.open(filename, mode, buffering)
  (env) razzamataz:chaptermarkers colin$ 
  </code></pre>