Revert "[CodeHealth] Migrate remainder of testing/ to Python3 compatible syntax"
This reverts commit 8defc6c6da91e4b7d7a686b7bb67658d9a5ebe55.
Reason for revert: Makes win-chrome fail:
https://ci.chromium.org/p/chrome/builders/try/win-chrome/4538
Original change's description:
> [CodeHealth] Migrate remainder of testing/ to Python3 compatible syntax
>
> 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: I74384a8cbd77e0db5adbbd5815d54e836472b756
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3607233
Auto-Submit: Sebastien Lalancette <[email protected]>
Reviewed-by: Ben Pastene <[email protected]>
Commit-Queue: Ben Pastene <[email protected]>
Cr-Commit-Position: refs/heads/main@{#996362}
diff --git a/testing/xvfb_unittest.py b/testing/xvfb_unittest.py
index 47b78f8..f28b6d2 100755
--- a/testing/xvfb_unittest.py
+++ b/testing/xvfb_unittest.py
@@ -16,8 +16,6 @@
import time
import unittest
-# pylint: disable=super-with-arguments
-
TEST_FILE = __file__.replace('.pyc', '.py')
XVFB = TEST_FILE.replace('_unittest', '')
@@ -31,13 +29,11 @@
stderr=subprocess.STDOUT, env=os.environ.copy())
-# 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.read().decode('utf-8').splitlines(True):
+ for line in proc.stdout:
if line.startswith(starts_with):
return line.rstrip().replace(starts_with, '')
-# pylint: enable=inconsistent-return-statements
def send_signal(proc, sig, sleep_time=0.3):
@@ -51,7 +47,7 @@
def setUp(self):
super(XvfbLinuxTest, self).setUp()
- if sys.platform != 'linux':
+ if sys.platform != 'linux2':
self.skipTest('linux only test')
def test_no_xvfb_display(self):
@@ -96,13 +92,13 @@
proc = launch_process(['--sleep'])
send_signal(proc, signal.SIGINT, 1)
sig = read_subprocess_message(proc, 'Signal :')
- self.assertEqual(int(sig), int(signal.SIGINT))
+ self.assertEqual(sig, str(signal.SIGINT))
def test_send_sigterm(self):
proc = launch_process(['--sleep'])
send_signal(proc, signal.SIGTERM, 1)
sig = read_subprocess_message(proc, 'Signal :')
- self.assertEqual(int(sig), int(signal.SIGTERM))
+ self.assertEqual(sig, str(signal.SIGTERM))
if __name__ == '__main__':
unittest.main()