]> granicus.if.org Git - python/commitdiff
Use proper skip instead of reporting success in one distutils test
authorÉric Araujo <aeric@mtlpy.org>
Sun, 9 Dec 2012 03:30:47 +0000 (22:30 -0500)
committerÉric Araujo <aeric@mtlpy.org>
Sun, 9 Dec 2012 03:30:47 +0000 (22:30 -0500)
Lib/distutils/tests/test_register.py

index 9a0ff34c45177e02adf540a945a657b3dc91de6a..4f34b18bd8f23fd05e4dfcc314157734eecd5658 100644 (file)
@@ -194,6 +194,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
         self.assertEqual(headers['Content-length'], '290')
         self.assertTrue('tarek' in req.data)
 
+    @unittest.skipUnless(docutils is not None, 'needs docutils')
     def test_strict(self):
         # testing the script option
         # when on, the register command stops if
@@ -206,13 +207,6 @@ class RegisterTestCase(PyPIRCCommandTestCase):
         cmd.strict = 1
         self.assertRaises(DistutilsSetupError, cmd.run)
 
-        # we don't test the reSt feature if docutils
-        # is not installed
-        try:
-            import docutils
-        except ImportError:
-            return
-
         # metadata are OK but long_description is broken
         metadata = {'url': 'xxx', 'author': 'xxx',
                     'author_email': u'éxéxé',