from robot import run_cli
import os
import sys
from chromedriver import CHROMEDRV_PATH

sys.path.append(CHROMEDRV_PATH)


def runner():
    args = sys.argv[1:]
    if '-d' not in args:
        directory = os.path.join(os.getcwd(), 'test_output')
        if not os.path.exists(directory):
            os.mkdir(directory)
        args += ['-d', directory]
    args.append(os.path.join(os.path.dirname(__file__), 'tests_files'))
    return run_cli(args)

@@ -1,12 +1,52 @@
+from chromedriver import CHROMEDRV_PATH%0A
 from robot i
@@ -83,48 +83,8 @@
  sys
-%0Afrom chromedriver import CHROMEDRV_PATH
 %0A%0Asy

Reorder imports in runner.py