'ROBOT' has two functions to run tests.
run(): Function to run tests.
run_cli(): Function to run tests with command line argument processing.
In 'Python27\Lib\site-packages\robot\utils\application.py'
def execute_cli(self, cli_arguments):
with self._logging():
options, arguments = self._parse_arguments(cli_arguments)
rc = self._execute(arguments, options)
self._exit(rc)
def execute(self, *arguments, **options):
with self._logging():
return self._execute(list(arguments), options)
'execute_cli' call 'self._parse_arguments(cli_arguments)',so argument 'pythonpath' can be used.
'def parse_args' → '_handle_special_options'
the method '_handle_special_options' call
if self._auto_pythonpath and opts.get('pythonpath'):
sys.path = self._get_pythonpath(opts['pythonpath']) + sys.path
So you must to update method 'def execute'
def execute(self, *arguments, **options):
with self._logging():
if options['pythonpath']:
sys.path=[options['pythonpath']]+sys.path
del options['pythonpath']
return self._execute(list(arguments), options)