PY-23452, IDEA-CR-20415: Helpers go to the tail of sys.path

This commit is contained in:
Ilya.Kazakevich
2017-04-25 01:37:50 +03:00
parent 778916e331
commit b6c627382b
+6 -2
View File
@@ -375,8 +375,12 @@ def jb_start_tests():
# PyCharm helpers dir is first dir in sys.path because helper is launched.
# But sys.path should be same as when launched with test runner directly
if os.path.abspath(sys.path[0]) == os.path.abspath(os.environ["PYCHARM_HELPERS_DIR"]):
sys.path.pop(0)
try:
if os.path.abspath(sys.path[0]) == os.path.abspath(os.environ["PYCHARM_HELPERS_DIR"]):
helpers_path = sys.path.pop(0)
sys.path.append(helpers_path)
except KeyError:
pass
return namespace.path, namespace.target, additional_args