summaryrefslogtreecommitdiffstats
path: root/googletest/test/googletest-list-tests-unittest.py
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@google.com>2023-01-17 20:15:50 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-01-17 20:16:29 (GMT)
commitbdb3b0a4939228f28fcb38e786cc29b79db463ab (patch)
tree0c6382619283863973c89e6027e83103190f1cf0 /googletest/test/googletest-list-tests-unittest.py
parentbba28fa8b2ef2d9725302ab8da0ca7c1a4a81715 (diff)
downloadgoogletest-bdb3b0a4939228f28fcb38e786cc29b79db463ab.zip
googletest-bdb3b0a4939228f28fcb38e786cc29b79db463ab.tar.gz
googletest-bdb3b0a4939228f28fcb38e786cc29b79db463ab.tar.bz2
Replace deprecated python calls
assert_ -> assertTrue/assertFalse/assertIn/assertNotIn assertEquals -> assertEqual PiperOrigin-RevId: 502654909 Change-Id: I25d30095a83c3806606cb80d676b3c979495e6bd
Diffstat (limited to 'googletest/test/googletest-list-tests-unittest.py')
-rwxr-xr-xgoogletest/test/googletest-list-tests-unittest.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/googletest/test/googletest-list-tests-unittest.py b/googletest/test/googletest-list-tests-unittest.py
index 9d56883..485150d 100755
--- a/googletest/test/googletest-list-tests-unittest.py
+++ b/googletest/test/googletest-list-tests-unittest.py
@@ -156,17 +156,24 @@ class GTestListTestsUnitTest(gtest_test_utils.TestCase):
output = Run(args)
if expected_output_re:
- self.assert_(
+ self.assertTrue(
expected_output_re.match(output),
- ('when %s is %s, the output of "%s" is "%s",\n'
- 'which does not match regex "%s"' %
- (LIST_TESTS_FLAG, flag_expression, ' '.join(args), output,
- expected_output_re.pattern)))
+ 'when %s is %s, the output of "%s" is "%s",\n'
+ 'which does not match regex "%s"'
+ % (
+ LIST_TESTS_FLAG,
+ flag_expression,
+ ' '.join(args),
+ output,
+ expected_output_re.pattern,
+ ),
+ )
else:
- self.assert_(
+ self.assertTrue(
not EXPECTED_OUTPUT_NO_FILTER_RE.match(output),
- ('when %s is %s, the output of "%s" is "%s"'%
- (LIST_TESTS_FLAG, flag_expression, ' '.join(args), output)))
+ 'when %s is %s, the output of "%s" is "%s"'
+ % (LIST_TESTS_FLAG, flag_expression, ' '.join(args), output),
+ )
def testDefaultBehavior(self):
"""Tests the behavior of the default mode."""