diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-10-04 20:55:52 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-10-04 20:55:52 +0300 |
commit | f7813318848865c2032b974eda7906a748264cce (patch) | |
tree | 329e557aa7e671ef321e80c8933fc608171f344e | |
parent | b8032e136b864af0607c781371ee6a8730f67efc (diff) | |
parent | fcfcd98f027f7a3066171b3eb3bb2ba4169ffeb3 (diff) | |
download | python-setuptools-git-f7813318848865c2032b974eda7906a748264cce.tar.gz |
Issue #28222: Merge from 3.6
-rw-r--r-- | tests/test_check.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/test_check.py b/tests/test_check.py index 959fa908..3d22868e 100644 --- a/tests/test_check.py +++ b/tests/test_check.py @@ -7,6 +7,12 @@ from distutils.command.check import check, HAS_DOCUTILS 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 @@ class CheckTestCase(support.LoggingSilencer, 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): |