From cafe6b588d591b80c9015108755333ceacc634e0 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Tue, 12 Sep 2023 16:15:31 -0700 Subject: [PATCH] pyright p2 --- pythonFiles/unittestadapter/discovery.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pythonFiles/unittestadapter/discovery.py b/pythonFiles/unittestadapter/discovery.py index 6097e52ef5872..6208d24bee9fc 100644 --- a/pythonFiles/unittestadapter/discovery.py +++ b/pythonFiles/unittestadapter/discovery.py @@ -141,8 +141,13 @@ def post_response(payload: PayloadDict | EOTPayloadDict, port: int, uuid: str) - # Perform test discovery. port, uuid = parse_discovery_cli_args(argv[:index]) # Post this discovery payload. - payload = discover_tests(start_dir, pattern, top_level_dir, uuid) - post_response(payload, port, uuid) - # Post EOT token. - eot_payload: EOTPayloadDict = {"command_type": "discovery", "eot": True} - post_response(eot_payload, port, uuid) + if uuid is not None: + payload = discover_tests(start_dir, pattern, top_level_dir, uuid) + post_response(payload, port, uuid) + # Post EOT token. + eot_payload: EOTPayloadDict = {"command_type": "discovery", "eot": True} + post_response(eot_payload, port, uuid) + else: + print("Error: no uuid provided or parsed.") + eot_payload: EOTPayloadDict = {"command_type": "discovery", "eot": True} + post_response(eot_payload, port, "")