aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_cmd_line_script.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r--Lib/test/test_cmd_line_script.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 53dc9b1a7ef..784c45aa96f 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -553,9 +553,9 @@ class CmdLineTest(unittest.TestCase):
exitcode, stdout, stderr = assert_python_failure(script_name)
text = stderr.decode('ascii').split('\n')
self.assertEqual(len(text), 5)
- self.assertTrue(text[0].startswith('Traceback'))
- self.assertTrue(text[1].startswith(' File '))
- self.assertTrue(text[3].startswith('NameError'))
+ self.assertStartsWith(text[0], 'Traceback')
+ self.assertStartsWith(text[1], ' File ')
+ self.assertStartsWith(text[3], 'NameError')
def test_non_ascii(self):
# Apple platforms deny the creation of a file with an invalid UTF-8 name.
@@ -708,9 +708,8 @@ class CmdLineTest(unittest.TestCase):
exitcode, stdout, stderr = assert_python_failure(script_name)
text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read()
# It used to crash in https://github.com/python/cpython/issues/111132
- self.assertTrue(text.endswith(
- 'SyntaxError: nonlocal declaration not allowed at module level\n',
- ), text)
+ self.assertEndsWith(text,
+ 'SyntaxError: nonlocal declaration not allowed at module level\n')
def test_consistent_sys_path_for_direct_execution(self):
# This test case ensures that the following all give the same