Commits

Éric Araujo  committed 7d4098c

Tighten tests for #13399

  • Participants
  • Parent commits 1c09e0c

Comments (0)

Files changed (1)

File distutils2/tests/test_run.py

         # sadly this message comes straight from the getopt module and can't be
         # modified to use repr instead of str for the unknown option; to be
         # changed when the command line parsers are replaced by something clean
-        self.assertEqual(err.splitlines()[-1],
-                         'error: option --unknown not recognized')
+        self.assertEqual(err.splitlines(),
+                         ['error: option --unknown not recognized'])
 
     def test_invalid_command(self):
         out, err = self.call_pysetup_fail('run', 'com#mand')
         self.assertGreater(out, 1)
-        self.assertEqual(err.splitlines()[-1],
-                         "error: invalid command name 'com#mand'")
+        self.assertEqual(err.splitlines(),
+                         ["error: invalid command name 'com#mand'"])
 
     def test_unknown_command(self):
         out, err = self.call_pysetup_fail('run', 'invalid_command')
         self.assertGreater(out, 1)
-        self.assertEqual(err.splitlines()[-1],
-                         "error: command 'invalid_command' not recognized")
+        self.assertEqual(err.splitlines(),
+                         ["error: command 'invalid_command' not recognized"])
 
     def test_unknown_action(self):
         out, err = self.call_pysetup_fail('invalid_action')
         self.assertGreater(out, 1)
-        self.assertEqual(err.splitlines()[-1],
-                         "error: action 'invalid_action' not recognized")
+        self.assertEqual(err.splitlines(),
+                         ["error: action 'invalid_action' not recognized"])
 
 
 def test_suite():