1 #!/usr/bin/env vpython3
2 # Copyright 2022 The Chromium Authors
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5 """Simple helper script to run pytype on //testing code."""
10 from pytype_common import pytype_runner
12 TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
13 CHROMIUM_SRC_DIR = os.path.realpath(os.path.join(TESTING_DIR, '..'))
15 EXTRA_PATHS_COMPONENTS = [
16 ('third_party', 'catapult', 'third_party', 'typ'),
19 os.path.join(CHROMIUM_SRC_DIR, *p) for p in EXTRA_PATHS_COMPONENTS
21 EXTRA_PATHS.append(TESTING_DIR)
23 FILES_AND_DIRECTORIES_TO_CHECK = [
24 'unexpected_passes_common',
25 'flake_suppressor_common',
27 FILES_AND_DIRECTORIES_TO_CHECK = [
28 os.path.join(TESTING_DIR, f) for f in FILES_AND_DIRECTORIES_TO_CHECK
31 TEST_NAME = 'testing_pytype'
32 TEST_LOCATION = "//testing/run_pytype.py"
36 return pytype_runner.run_pytype(TEST_NAME, TEST_LOCATION,
37 FILES_AND_DIRECTORIES_TO_CHECK,
38 EXTRA_PATHS, TESTING_DIR)
41 if __name__ == '__main__':