1# Copyright 2018 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4"""Runs Python unit tests in this directory. 5""" 6 7PRESUBMIT_VERSION = '2.0.0' 8USE_PYTHON3 = True 9 10def CheckPythonUnittestsPass(input_api, output_api): 11 # The rust scripts and tests don't work on Windows. 12 if input_api.is_windows: 13 return [] 14 results = [] 15 this_dir = input_api.PresubmitLocalPath() 16 17 results += input_api.RunTests( 18 input_api.canned_checks.GetUnitTestsInDirectory( 19 input_api, 20 output_api, 21 this_dir, 22 files_to_check=['.*unittest.*\.py$'], 23 env=None, 24 run_on_python2=False, 25 run_on_python3=True, 26 skip_shebang_check=True)) 27 28 return results 29