Skip to content

Commit

Permalink
Fully drop support for python 2 in chromeos test_runner.
Browse files Browse the repository at this point in the history
This'll make the main entry-point (test_runner.py) error out if it
detects it's running on py2.

Bug: 1198282
Change-Id: I797dcb9e36184b9f7e66ba5555394789a5c59c13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2847242
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#875896}
  • Loading branch information
bpastene authored and Chromium LUCI CQ committed Apr 23, 2021
1 parent 9e9e1ec commit 01a4cf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build/chromeos/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def CommonChecks(input_api, output_api):
results += input_api.canned_checks.RunPylint(
input_api, output_api, pylintrc='pylintrc')
tests = input_api.canned_checks.GetUnitTestsInDirectory(
input_api, output_api, '.', [r'^.+_test\.py$'], run_on_python3=True)
input_api,
output_api,
'.', [r'^.+_test\.py$'],
run_on_python2=False,
run_on_python3=True)
results += input_api.RunTests(tests)
return results

Expand Down
2 changes: 2 additions & 0 deletions build/chromeos/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import psutil # pylint: disable=import-error
import six

assert not six.PY2, 'Use of this test runner with python 2 is not supported.'

CHROMIUM_SRC_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))

Expand Down

0 comments on commit 01a4cf7

Please sign in to comment.