From fb6570da9d343df001f34a1cfd32ce9f0363e7b8 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Fri, 21 Jul 2017 21:13:22 +0300 Subject: [PATCH] PY-25264: Do not access cwd in the middle of the test We need to know which folder been used as current dir, but user may change it while test is running so we shall not access it in the middle of the test --- python/helpers/pycharm/_jb_runner_tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/helpers/pycharm/_jb_runner_tools.py b/python/helpers/pycharm/_jb_runner_tools.py index 0b3089241f72..9588590009f8 100644 --- a/python/helpers/pycharm/_jb_runner_tools.py +++ b/python/helpers/pycharm/_jb_runner_tools.py @@ -18,7 +18,7 @@ if teamcity_presence_env_var not in os.environ: # anything sent to stdout/stderr goes to IDE directly, not after test is over like it is done by default. # out and err are not in sync, so output may go to wrong test JB_DISABLE_BUFFERING = "JB_DISABLE_BUFFERING" in os.environ - +PROJECT_DIR = os.getcwd() def _parse_parametrized(part): """ @@ -179,7 +179,7 @@ class NewTeamcityServiceMessages(_old_service_messages): loc = possible_location.find("(") if loc > 0: possible_location = possible_location[:loc].strip() - properties["locationHint"] = "python<{0}>://{1}".format(os.getcwd(), possible_location) + properties["locationHint"] = "python<{0}>://{1}".format(PROJECT_DIR, possible_location) except KeyError: # If message does not have name, then it is not test # Simply pass it @@ -399,4 +399,4 @@ def jb_doc_args(framework_name, args): Runner encouraged to report its arguments to user with aid of this function """ - print("Launching {0} with arguments {1} in {2}\n".format(framework_name, " ".join(args), os.getcwd())) + print("Launching {0} with arguments {1} in {2}\n".format(framework_name, " ".join(args), PROJECT_DIR))