mirror of
https://github.com/google/googletest.git
synced 2025-12-07 09:16:51 +08:00
Merge ff20316ec972fff47c63c7c1eba18d83a9655e55 into 1b96fa13f549387b7549cc89e1a785cf143a1a50
This commit is contained in:
commit
afeb775884
11
.github/workflows/lint_python.yml
vendored
Normal file
11
.github/workflows/lint_python.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# https://docs.github.com/en/actions
|
||||||
|
# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python
|
||||||
|
# https://docs.astral.sh/ruff
|
||||||
|
name: lint_python
|
||||||
|
on: [pull_request, push]
|
||||||
|
jobs:
|
||||||
|
lint_python:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/ruff-action@v3
|
||||||
@ -714,7 +714,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
|
|||||||
|
|
||||||
def testDisabledBanner(self):
|
def testDisabledBanner(self):
|
||||||
"""Tests that the disabled banner prints only tests that match filter."""
|
"""Tests that the disabled banner prints only tests that match filter."""
|
||||||
make_filter = lambda s: ['--%s=%s' % (FILTER_FLAG, s)]
|
make_filter = lambda s: ['--%s=%s' % (FILTER_FLAG, s)] # noqa: E731
|
||||||
|
|
||||||
banners = RunAndExtractDisabledBannerList(make_filter('*'))
|
banners = RunAndExtractDisabledBannerList(make_filter('*'))
|
||||||
self.AssertSetEqual(
|
self.AssertSetEqual(
|
||||||
|
|||||||
@ -119,7 +119,7 @@ def GetTestCases(tests):
|
|||||||
test_cases = []
|
test_cases = []
|
||||||
for test in tests:
|
for test in tests:
|
||||||
test_case = test.split('.')[0]
|
test_case = test.split('.')[0]
|
||||||
if not test_case in test_cases:
|
if test_case not in test_cases:
|
||||||
test_cases.append(test_case)
|
test_cases.append(test_case)
|
||||||
|
|
||||||
return test_cases
|
return test_cases
|
||||||
|
|||||||
@ -31,20 +31,18 @@
|
|||||||
# Suppresses the 'Import not at the top of the file' lint complaint.
|
# Suppresses the 'Import not at the top of the file' lint complaint.
|
||||||
# pylint: disable=g-import-not-at-top
|
# pylint: disable=g-import-not-at-top
|
||||||
|
|
||||||
|
import atexit
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
|
import unittest as _test_module
|
||||||
|
|
||||||
IS_WINDOWS = os.name == 'nt'
|
IS_WINDOWS = os.name == 'nt'
|
||||||
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
|
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
|
||||||
IS_OS2 = os.name == 'os2'
|
IS_OS2 = os.name == 'os2'
|
||||||
|
|
||||||
import atexit
|
|
||||||
import shutil
|
|
||||||
import tempfile
|
|
||||||
import unittest as _test_module
|
|
||||||
# pylint: enable=g-import-not-at-top
|
|
||||||
|
|
||||||
GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
|
GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
|
||||||
|
|
||||||
# The environment variable for specifying the path to the premature-exit file.
|
# The environment variable for specifying the path to the premature-exit file.
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
"""Unit test for the gtest_xml_output module."""
|
"""Unit test for the gtest_xml_output module."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from xml.dom import minidom, Node
|
from xml.dom import minidom
|
||||||
from googletest.test import gtest_test_utils
|
from googletest.test import gtest_test_utils
|
||||||
from googletest.test import gtest_xml_test_utils
|
from googletest.test import gtest_xml_test_utils
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
"""Unit test utilities for gtest_xml_output"""
|
"""Unit test utilities for gtest_xml_output"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from xml.dom import minidom, Node
|
from xml.dom import Node
|
||||||
from googletest.test import gtest_test_utils
|
from googletest.test import gtest_test_utils
|
||||||
|
|
||||||
GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml'
|
GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user