Fix formatting in subset of Python files

These files were formatted with automated tools. The remaining Python
files require some manual fix ups, so they will be fixed separately.

PiperOrigin-RevId: 504579820
Change-Id: I3923bd414bffe3ded6163ec496cd09ace3951928
This commit is contained in:
Tom Hughes
2023-01-25 09:13:35 -08:00
committed by Copybara-Service
parent 6c65a1ca35
commit d1ad27e0a4
24 changed files with 1475 additions and 1343 deletions

View File

@@ -54,50 +54,59 @@ class GMockLeakTest(gmock_test_utils.TestCase):
def testCatchesLeakedMockByDefault(self):
self.assertNotEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL,
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_WITH_EXPECT_CALL, env=environ
).exit_code,
)
self.assertNotEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_ON_CALL,
env=environ).exit_code)
0, gmock_test_utils.Subprocess(TEST_WITH_ON_CALL, env=environ).exit_code
)
def testDoesNotCatchLeakedMockWhenDisabled(self):
self.assertEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
['--gmock_catch_leaked_mocks=0'],
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_WITH_EXPECT_CALL + ['--gmock_catch_leaked_mocks=0'],
env=environ,
).exit_code,
)
self.assertEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
['--gmock_catch_leaked_mocks=0'],
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_WITH_ON_CALL + ['--gmock_catch_leaked_mocks=0'], env=environ
).exit_code,
)
def testCatchesLeakedMockWhenEnabled(self):
self.assertNotEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
['--gmock_catch_leaked_mocks'],
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_WITH_EXPECT_CALL + ['--gmock_catch_leaked_mocks'], env=environ
).exit_code,
)
self.assertNotEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
['--gmock_catch_leaked_mocks'],
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_WITH_ON_CALL + ['--gmock_catch_leaked_mocks'], env=environ
).exit_code,
)
def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self):
self.assertNotEqual(
0,
gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
['--gmock_catch_leaked_mocks=1'],
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_WITH_EXPECT_CALL + ['--gmock_catch_leaked_mocks=1'],
env=environ,
).exit_code,
)
def testCatchesMultipleLeakedMocks(self):
self.assertNotEqual(
0,
gmock_test_utils.Subprocess(TEST_MULTIPLE_LEAKS +
['--gmock_catch_leaked_mocks'],
env=environ).exit_code)
gmock_test_utils.Subprocess(
TEST_MULTIPLE_LEAKS + ['--gmock_catch_leaked_mocks'], env=environ
).exit_code,
)
if __name__ == '__main__':

View File

@@ -39,7 +39,7 @@ gmock_output_test.py
"""
from io import open # pylint: disable=redefined-builtin, g-importing-member
from io import open # pylint: disable=redefined-builtin, g-importing-member
import os
import re
import sys
@@ -168,9 +168,13 @@ class GMockOutputTest(gmock_test_utils.TestCase):
# The raw output should contain 2 leaked mock object errors for
# test GMockOutputTest.CatchesLeakedMocks.
self.assertEqual(['GMockOutputTest.CatchesLeakedMocks',
'GMockOutputTest.CatchesLeakedMocks'],
leaky_tests)
self.assertEqual(
[
'GMockOutputTest.CatchesLeakedMocks',
'GMockOutputTest.CatchesLeakedMocks',
],
leaky_tests,
)
if __name__ == '__main__':