summaryrefslogtreecommitdiffstats
path: root/googletest/test/gtest_help_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/test/gtest_help_test.py')
-rwxr-xr-xgoogletest/test/gtest_help_test.py30
1 files changed, 7 insertions, 23 deletions
diff --git a/googletest/test/gtest_help_test.py b/googletest/test/gtest_help_test.py
index a76f220..3f78496 100755
--- a/googletest/test/gtest_help_test.py
+++ b/googletest/test/gtest_help_test.py
@@ -116,17 +116,14 @@ def RunWithFlag(flag):
class GTestHelpTest(gtest_test_utils.TestCase):
"""Tests the --help flag and its equivalent forms."""
- def TestHelpFlag(self, flag):
+ def testPrintsHelpWithFullFlag(self):
"""Verifies correct behavior when help flag is specified.
The right message must be printed and the tests must
skipped when the given flag is specified.
-
- Args:
- flag: A flag to pass to the binary or None.
"""
- exit_code, output = RunWithFlag(flag)
+ exit_code, output = RunWithFlag('--help')
if HAS_ABSL_FLAGS:
# The Abseil flags library prints the ProgramUsageMessage() with
# --help and returns 1.
@@ -146,32 +143,17 @@ class GTestHelpTest(gtest_test_utils.TestCase):
else:
self.assertNotIn(DEATH_TEST_STYLE_FLAG, output)
- def TestNonHelpFlag(self, flag):
+ def testRunsTestsWithoutHelpFlag(self):
"""Verifies correct behavior when no help flag is specified.
Verifies that when no help flag is specified, the tests are run
and the help message is not printed.
-
- Args:
- flag: A flag to pass to the binary or None.
"""
- exit_code, output = RunWithFlag(flag)
+ exit_code, output = RunWithFlag(None)
self.assertNotEqual(exit_code, 0)
self.assertFalse(HELP_REGEX.search(output), output)
- def testPrintsHelpWithFullFlag(self):
- self.TestHelpFlag('--help')
-
- def testRunsTestsWithoutHelpFlag(self):
- """Verifies correct behavior when no help flag is specified.
-
- Verifies that when no help flag is specified, the tests are run
- and the help message is not printed.
- """
-
- self.TestNonHelpFlag(None)
-
def testRunsTestsWithGtestInternalFlag(self):
"""Verifies correct behavior when internal testing flag is specified.
@@ -179,7 +161,9 @@ class GTestHelpTest(gtest_test_utils.TestCase):
a flag starting with Google Test prefix and 'internal_' is supplied.
"""
- self.TestNonHelpFlag(INTERNAL_FLAG_FOR_TESTING)
+ exit_code, output = RunWithFlag(INTERNAL_FLAG_FOR_TESTING)
+ self.assertNotEqual(exit_code, 0)
+ self.assertFalse(HELP_REGEX.search(output), output)
if __name__ == '__main__':