Skip to content

Commit 5c2c394

Browse files
Remove debug print statements from unittest adapter output (#25854)
`PROJECT_ROOT_PATH is set, using /... as cwd for execution payload` is printed to stdout during unittest discovery and execution, leaking into the Test Results panel. - Remove `print()` in `python_files/unittestadapter/execution.py` (execution path) - Remove `print()` in `python_files/unittestadapter/discovery.py` (discovery path) All functional logic (reading the env var, setting `top_level_dir`, updating the global) is unchanged. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
1 parent 29d3b6f commit 5c2c394

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

python_files/unittestadapter/discovery.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ def discover_tests(
146146
project_root_path = os.environ.get("PROJECT_ROOT_PATH")
147147
if project_root_path:
148148
top_level_dir = project_root_path
149-
print(
150-
f"PROJECT_ROOT_PATH is set, using {project_root_path} as top_level_dir for discovery"
151-
)
152149

153150
# Perform regular unittest test discovery.
154151
# Pass project_root_path so the payload's cwd matches the project root.

python_files/unittestadapter/execution.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,6 @@ def send_run_data(raw_data, test_run_pipe):
373373
# Update the module-level variable for send_run_data to use
374374
# pylint: disable=global-statement
375375
globals()["PROJECT_ROOT_PATH"] = project_root_path
376-
print(
377-
f"PROJECT_ROOT_PATH is set, using {project_root_path} as cwd for execution payload"
378-
)
379376

380377
# Perform regular unittest execution.
381378
# Pass project_root_path so the payload's cwd matches the project root.

0 commit comments

Comments
 (0)