diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-12-02 17:14:05 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-12-02 17:14:05 +0000 |
commit | b020c76a6954fec5f093cdcd2c1991c2485cec04 (patch) | |
tree | d2c2a006092dd4d2a09be67c55b678bd85d0aefc | |
parent | ea7648566091d977de9aa850d1c7ff1c18786d06 (diff) | |
download | docutils-b020c76a6954fec5f093cdcd2c1991c2485cec04.tar.gz |
Simplify error message if recommonmark is missing.
As we provide a mock Sphinx package, there is no need to emphasise
recommonmark's dependency on Sphinx.
Wrap error message. Adapt the test case.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9302 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | docutils/docutils/parsers/recommonmark_wrapper.py | 5 | ||||
-rw-r--r-- | docutils/test/test_parsers/test_get_parser_class.py | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/docutils/docutils/parsers/recommonmark_wrapper.py b/docutils/docutils/parsers/recommonmark_wrapper.py index 6af18594f..ac16221f5 100644 --- a/docutils/docutils/parsers/recommonmark_wrapper.py +++ b/docutils/docutils/parsers/recommonmark_wrapper.py @@ -45,9 +45,8 @@ try: from recommonmark.parser import CommonMarkParser except ImportError as err: raise ImportError( - 'Parsing "recommonmark" Markdown flavour requires the ' - 'package https://pypi.org/project/recommonmark which ' - 'in turn depends on https://pypi.org/project/sphinx.' + 'Parsing "recommonmark" Markdown flavour requires the\n' + ' package https://pypi.org/project/recommonmark.' ) from err else: if recommonmark.__version__ < '0.6.0': diff --git a/docutils/test/test_parsers/test_get_parser_class.py b/docutils/test/test_parsers/test_get_parser_class.py index c3d6da43e..ed6a9a547 100644 --- a/docutils/test/test_parsers/test_get_parser_class.py +++ b/docutils/test/test_parsers/test_get_parser_class.py @@ -49,7 +49,7 @@ class RecommonmarkMissingTests(unittest.TestCase): def test_missing_parser_message(self): with self.assertRaisesRegex(ImportError, - 'requires the package .*recommonmark'): + 'requires the.*package .* recommonmark'): publish_string('test data', parser_name='recommonmark') |