[Python-checkins] cpython (merge 3.6 -> default): Issue #28222: Merge from 3.6

berker.peksag python-checkins at python.org
Tue Oct 4 13:53:28 EDT 2016


https://hg.python.org/cpython/rev/e0c1bc2e98ed
changeset:   104294:e0c1bc2e98ed
parent:      104291:76591498aab7
parent:      104293:d5eefcfa3458
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Tue Oct 04 20:55:52 2016 +0300
summary:
  Issue #28222: Merge from 3.6

files:
  Lib/distutils/tests/test_check.py |  16 ++++++++++++++--
  1 files changed, 14 insertions(+), 2 deletions(-)


diff --git a/Lib/distutils/tests/test_check.py b/Lib/distutils/tests/test_check.py
--- a/Lib/distutils/tests/test_check.py
+++ b/Lib/distutils/tests/test_check.py
@@ -7,6 +7,12 @@
 from distutils.tests import support
 from distutils.errors import DistutilsSetupError
 
+try:
+    import pygments
+except ImportError:
+    pygments = None
+
+
 class CheckTestCase(support.LoggingSilencer,
                     support.TempdirManager,
                     unittest.TestCase):
@@ -119,9 +125,15 @@
             pkg_info, dist = self.create_dist(long_description=rest_with_code)
             cmd = check(dist)
             cmd.check_restructuredtext()
-            self.assertEqual(cmd._warnings, 0)
             msgs = cmd._check_rst_data(rest_with_code)
-            self.assertEqual(len(msgs), 0)
+            if pygments is not None:
+                self.assertEqual(len(msgs), 0)
+            else:
+                self.assertEqual(len(msgs), 1)
+                self.assertEqual(
+                    str(msgs[0][1]),
+                    'Cannot analyze code. Pygments package not found.'
+                )
 
     def test_check_all(self):
 

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


More information about the Python-checkins mailing list