pw_unit_test: Fix forward for result sink bug

Fixes a bug with http://pwrev/111472 that resulted in tests always
failing to run locally.

Tested: Using pw watch locally, which reproduced the bug and confirmed the fix works.
Change-Id: Ib8691821182b77ffa043d8dad4380502632241a3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112010
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_unit_test/py/pw_unit_test/test_runner.py b/pw_unit_test/py/pw_unit_test/test_runner.py
index 4dc263d..816790f 100644
--- a/pw_unit_test/py/pw_unit_test/test_runner.py
+++ b/pw_unit_test/py/pw_unit_test/test_runner.py
@@ -148,6 +148,7 @@
         self._args: Sequence[str] = args
         self._tests: List[Test] = list(tests)
         self._timeout = timeout
+        self._result_sink: Optional[Dict[str, str]] = None
 
         # Access go/result-sink, if available.
         ctx_path = Path(os.environ.get("LUCI_CONTEXT", ''))
@@ -155,8 +156,7 @@
             return
 
         ctx = json.loads(ctx_path.read_text(encoding='utf-8'))
-        self._result_sink: Optional[Dict[str,
-                                         str]] = ctx.get('result_sink', None)
+        self._result_sink = ctx.get('result_sink', None)
 
     async def run_tests(self) -> None:
         """Runs all registered unit tests through the runner script."""