Skip to content

Commit

Permalink
switch to conditional error message on check for UUID and port during…
Browse files Browse the repository at this point in the history
… pytest config (microsoft#22534)

fixes microsoft#19857
  • Loading branch information
eleanorjboyd authored Nov 27, 2023
1 parent 9a5363c commit 1639753
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pythonFiles/vscode_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ def pytest_load_initial_conftests(early_config, parser, args):
global TEST_UUID
TEST_PORT = os.getenv("TEST_PORT")
TEST_UUID = os.getenv("TEST_UUID")
error_string = (
"PYTEST ERROR: TEST_UUID and/or TEST_PORT are not set at the time of pytest starting. Please confirm these environment variables are not being"
" changed or removed as they are required for successful test discovery and execution."
f" \nTEST_UUID = {TEST_UUID}\nTEST_PORT = {TEST_PORT}\n"
)
print(error_string, file=sys.stderr)
if TEST_UUID is None or TEST_PORT is None:
error_string = (
"PYTEST ERROR: TEST_UUID and/or TEST_PORT are not set at the time of pytest starting. Please confirm these environment variables are not being"
" changed or removed as they are required for successful test discovery and execution."
f" \nTEST_UUID = {TEST_UUID}\nTEST_PORT = {TEST_PORT}\n"
)
print(error_string, file=sys.stderr)
if "--collect-only" in args:
global IS_DISCOVERY
IS_DISCOVERY = True
Expand Down

0 comments on commit 1639753

Please sign in to comment.