diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-10-04 17:55:52 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-10-04 17:55:52 (GMT) |
commit | f7b8d5d4eb0541a747d295024d869aea4c111642 (patch) | |
tree | 66dae9ea3332b6e0ad3bd89aaa24cf203ad8c4d4 /Lib/distutils | |
parent | ea1f9b934cea21efd525aba5c459d25f28f9ddea (diff) | |
parent | d3dbba41744dd223f9367882c9e2e65a0c56138e (diff) | |
download | cpython-f7b8d5d4eb0541a747d295024d869aea4c111642.zip cpython-f7b8d5d4eb0541a747d295024d869aea4c111642.tar.gz cpython-f7b8d5d4eb0541a747d295024d869aea4c111642.tar.bz2 |
Issue #28222: Merge from 3.6
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | 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 index 959fa90..3d22868 100644 --- a/Lib/distutils/tests/test_check.py +++ b/Lib/distutils/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): |