Replace numeric lints with their string equivalent
PiperOrigin-RevId: 504570278 Change-Id: Iab9c988b3a781eaafbdd97c924a74c2269125799
This commit is contained in:
parent
2491710524
commit
6c65a1ca35
@ -285,13 +285,13 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
|
|||||||
# into a process using the environment variable. However, we can still
|
# into a process using the environment variable. However, we can still
|
||||||
# test the case when the variable is not supplied (i.e., gtest_filter is
|
# test the case when the variable is not supplied (i.e., gtest_filter is
|
||||||
# None).
|
# None).
|
||||||
# pylint: disable-msg=C6403
|
# pylint: disable=g-explicit-bool-comparison
|
||||||
if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
|
if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
|
||||||
SetEnvVar(FILTER_ENV_VAR, gtest_filter)
|
SetEnvVar(FILTER_ENV_VAR, gtest_filter)
|
||||||
tests_run = RunAndExtractTestList()[0]
|
tests_run = RunAndExtractTestList()[0]
|
||||||
SetEnvVar(FILTER_ENV_VAR, None)
|
SetEnvVar(FILTER_ENV_VAR, None)
|
||||||
self.AssertSetEqual(tests_run, tests_to_run)
|
self.AssertSetEqual(tests_run, tests_to_run)
|
||||||
# pylint: enable-msg=C6403
|
# pylint: enable=g-explicit-bool-comparison
|
||||||
|
|
||||||
# Next, tests using the command line flag.
|
# Next, tests using the command line flag.
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
|
|||||||
# into a process using the environment variable. However, we can still
|
# into a process using the environment variable. However, we can still
|
||||||
# test the case when the variable is not supplied (i.e., gtest_filter is
|
# test the case when the variable is not supplied (i.e., gtest_filter is
|
||||||
# None).
|
# None).
|
||||||
# pylint: disable-msg=C6403
|
# pylint: disable=g-explicit-bool-comparison
|
||||||
if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
|
if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
|
||||||
SetEnvVar(FILTER_ENV_VAR, gtest_filter)
|
SetEnvVar(FILTER_ENV_VAR, gtest_filter)
|
||||||
partition = []
|
partition = []
|
||||||
@ -340,7 +340,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
|
|||||||
|
|
||||||
self.AssertPartitionIsValid(tests_to_run, partition)
|
self.AssertPartitionIsValid(tests_to_run, partition)
|
||||||
SetEnvVar(FILTER_ENV_VAR, None)
|
SetEnvVar(FILTER_ENV_VAR, None)
|
||||||
# pylint: enable-msg=C6403
|
# pylint: enable=g-explicit-bool-comparison
|
||||||
|
|
||||||
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
|
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
|
||||||
"""Checks that the binary runs correct set of tests for the given filter.
|
"""Checks that the binary runs correct set of tests for the given filter.
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
"""Unit test utilities for Google C++ Testing and Mocking Framework."""
|
"""Unit test utilities for Google C++ Testing and Mocking Framework."""
|
||||||
# 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-msg=C6204
|
# pylint: disable=g-import-not-at-top
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -43,7 +43,7 @@ import atexit
|
|||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest as _test_module
|
import unittest as _test_module
|
||||||
# pylint: enable-msg=C6204
|
# pylint: enable=g-import-not-at-top
|
||||||
|
|
||||||
GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
|
GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user