[Python-checkins] cpython (2.7): condense two tests with the same name (closes #19114)

benjamin.peterson python-checkins at python.org
Sun Sep 29 17:14:02 CEST 2013


http://hg.python.org/cpython/rev/61ae31665ee1
changeset:   85845:61ae31665ee1
branch:      2.7
parent:      85842:959e894dc794
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Sep 29 11:13:27 2013 -0400
summary:
  condense two tests with the same name (closes #19114)

files:
  Lib/distutils/tests/test_cmd.py |  25 ++++++++++----------
  1 files changed, 12 insertions(+), 13 deletions(-)


diff --git a/Lib/distutils/tests/test_cmd.py b/Lib/distutils/tests/test_cmd.py
--- a/Lib/distutils/tests/test_cmd.py
+++ b/Lib/distutils/tests/test_cmd.py
@@ -34,6 +34,18 @@
         self.assertRaises(DistutilsOptionError,
                           cmd.ensure_string_list, 'not_string_list2')
 
+        cmd.option1 = 'ok,dok'
+        cmd.ensure_string_list('option1')
+        self.assertEqual(cmd.option1, ['ok', 'dok'])
+
+        cmd.option2 = ['xxx', 'www']
+        cmd.ensure_string_list('option2')
+
+        cmd.option3 = ['ok', 2]
+        self.assertRaises(DistutilsOptionError, cmd.ensure_string_list,
+                          'option3')
+
+
     def test_make_file(self):
 
         cmd = self.cmd
@@ -77,19 +89,6 @@
         cmd.option3 = 1
         self.assertRaises(DistutilsOptionError, cmd.ensure_string, 'option3')
 
-    def test_ensure_string_list(self):
-        cmd = self.cmd
-        cmd.option1 = 'ok,dok'
-        cmd.ensure_string_list('option1')
-        self.assertEqual(cmd.option1, ['ok', 'dok'])
-
-        cmd.option2 = ['xxx', 'www']
-        cmd.ensure_string_list('option2')
-
-        cmd.option3 = ['ok', 2]
-        self.assertRaises(DistutilsOptionError, cmd.ensure_string_list,
-                          'option3')
-
     def test_ensure_filename(self):
         cmd = self.cmd
         cmd.option1 = __file__

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list