drothlis/stb-tester — pull request #55 by szemate (2013-09-13 14:19:12+00:00)
Title: stbt-run: Let a test script access its real path

If a test script is executed with `python` (without stbt):
- the script's directory is added to the beginning of `sys.path`, therefore
it's possible to import a module from the script's directory;
- the script's path is accessible through the `__file__` special variable.

If a test script is executed with `stbt run`:
- stbt-run's directory is iserted to `sys.path`, therefore it's not
possible to import a module from the script's directory;
- `__file__` variable contains the path of `stbt-run`.

To let a test script access its real path just like it was executed without
stb-tester, add the script's directory to `sys.path`, and override `__file__`
variable to contain the test script's path.