Reland "[CodeHealth] Migrate remainder of testing/ to Python3 compatible
syntax"
This is a reland of commit 8defc6c6da91e4b7d7a686b7bb67658d9a5ebe55
Uses `sys.path.append(...)` to import the `common` module in
testing/scripts/run_variations_smoke_tests.py (as is done elsewhere in
the original CL) and resolve errors thrown for attempting a relative
import with no known parent package.
Original change's description:
>and Pylint2.7, and fix resulting errors.
>
>Bug: 1262363
>Change-Id: I09628427dd4caf9d873f3b489b897054430f8567
>Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557490
>Reviewed-by: Ben Pastene <[email protected]>
>Commit-Queue: Joshua Hood <[email protected]>
>Cr-Commit-Position: refs/heads/main@{#996200}
Bug: 1262363
Change-Id: I60fe062f62962d0b3dc4e93d9e29626ed181f688
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3610783
Reviewed-by: Ben Pastene <[email protected]>
Commit-Queue: Joshua Hood <[email protected]>
Cr-Commit-Position: refs/heads/main@{#999432}
diff --git a/testing/test_env_unittest.py b/testing/test_env_unittest.py
index 707c65e..8ec6194 100755
--- a/testing/test_env_unittest.py
+++ b/testing/test_env_unittest.py
@@ -20,6 +20,8 @@
HERE = os.path.dirname(os.path.abspath(__file__))
TEST_SCRIPT = os.path.join(HERE, 'test_env_user_script.py')
+# pylint: disable=super-with-arguments
+
def launch_process_windows(args):
# The `universal_newlines` option is equivalent to `text` in Python 3.
@@ -42,11 +44,13 @@
universal_newlines=True)
+# pylint: disable=inconsistent-return-statements
def read_subprocess_message(proc, starts_with):
"""Finds the value after first line prefix condition."""
for line in proc.stdout:
if line.startswith(starts_with):
return line.rstrip().replace(starts_with, '')
+# pylint: enable=inconsistent-return-statements
def send_and_wait(proc, sig, sleep_time=0.3):
@@ -65,9 +69,9 @@
def test_send_ctrl_break_event(self):
proc = launch_process_windows([])
- send_and_wait(proc, signal.CTRL_BREAK_EVENT)
+ send_and_wait(proc, signal.CTRL_BREAK_EVENT) # pylint: disable=no-member
sig = read_subprocess_message(proc, 'Signal :')
- self.assertEqual(sig, str(int(signal.SIGBREAK)))
+ self.assertEqual(sig, str(int(signal.SIGBREAK))) # pylint: disable=no-member
class SignalingNonWindowsTest(unittest.TestCase):