xref: /aosp_15_r20/external/cronet/testing/scripts/rust/PRESUBMIT.py (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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=['.*unittest.*\.py$'],
22            env=None))
23
24    return results
25