• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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'
8
9def CheckPythonUnittestsPass(input_api, output_api):
10    # The rust scripts and tests don't work on Windows.
11    if input_api.is_windows:
12        return []
13    results = []
14    this_dir = input_api.PresubmitLocalPath()
15
16    results += input_api.RunTests(
17        input_api.canned_checks.GetUnitTestsInDirectory(
18            input_api,
19            output_api,
20            this_dir,
21            files_to_check=[r'.*unittest.*\.py$'],
22            env=None))
23
24    return results
25