Enforce formatting of all py files under //testing/

Some subdirs have their own .style.yapf files (like
//testing/pytype_common/), but most do not. This has lead to a lot of
python code in //testing/ naturally being developed with no
consistent styling. This can make things a little hard to read when
put in the context of other py code throughout the repo that's much
more consistent.

So this:
- adds a basic //testing/.style.yapf file
- adds another testing/trigger_scripts/.style.yapf file that's similar
  but sets indent to 4, since the code in that dir currently uses
  4 indents
- reformats everything
- adds a presubmit checkout to //testing/PRESUBMIT.py to enforce that
  things stay formatted

Bug: 340623285
Change-Id: I2a6707ba2f6f784454d348a19280dca2ca90804b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5540460
Commit-Queue: Ben Pastene <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1301583}
diff --git a/testing/test_env_unittest.py b/testing/test_env_unittest.py
index 563947c1..bc24aad 100755
--- a/testing/test_env_unittest.py
+++ b/testing/test_env_unittest.py
@@ -2,7 +2,6 @@
 # Copyright 2019 The Chromium Authors
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
-
 """Unit tests for test_env.py functionality.
 
 Each unit test is launches python process that uses test_env.py
@@ -23,23 +22,21 @@
 
 def launch_process_windows(args):
   # The `universal_newlines` option is equivalent to `text` in Python 3.
-  return subprocess.Popen(
-      [sys.executable, TEST_SCRIPT] + args,
-      stdout=subprocess.PIPE,
-      stderr=subprocess.STDOUT,
-      env=os.environ.copy(),
-      creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,
-      universal_newlines=True)
+  return subprocess.Popen([sys.executable, TEST_SCRIPT] + args,
+                          stdout=subprocess.PIPE,
+                          stderr=subprocess.STDOUT,
+                          env=os.environ.copy(),
+                          creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,
+                          universal_newlines=True)
 
 
 def launch_process_nonwindows(args):
   # The `universal_newlines` option is equivalent to `text` in Python 3.
-  return subprocess.Popen(
-      [sys.executable, TEST_SCRIPT] + args,
-      stdout=subprocess.PIPE,
-      stderr=subprocess.STDOUT,
-      env=os.environ.copy(),
-      universal_newlines=True)
+  return subprocess.Popen([sys.executable, TEST_SCRIPT] + args,
+                          stdout=subprocess.PIPE,
+                          stderr=subprocess.STDOUT,
+                          env=os.environ.copy(),
+                          universal_newlines=True)
 
 
 # pylint: disable=inconsistent-return-statements
@@ -48,6 +45,8 @@
   for line in proc.stdout:
     if line.startswith(starts_with):
       return line.rstrip().replace(starts_with, '')
+
+
 # pylint: enable=inconsistent-return-statements
 
 
@@ -67,13 +66,13 @@
 
   def test_send_ctrl_break_event(self):
     proc = launch_process_windows([])
-    send_and_wait(proc, signal.CTRL_BREAK_EVENT) # pylint: disable=no-member
+    send_and_wait(proc, signal.CTRL_BREAK_EVENT)  # pylint: disable=no-member
     sig = read_subprocess_message(proc, 'Signal :')
     # This test is flaky because it relies on the child process starting quickly
     # "enough", which it fails to do sometimes. This is tracked by
     # https://crbug.com/1335123 and it is hoped that increasing the timeout will
     # reduce the flakiness.
-    self.assertEqual(sig, str(int(signal.SIGBREAK))) # pylint: disable=no-member
+    self.assertEqual(sig, str(int(signal.SIGBREAK)))  # pylint: disable=no-member
 
 
 class SignalingNonWindowsTest(unittest.TestCase):