diff options
Diffstat (limited to 'tests/test_application.py')
-rw-r--r-- | tests/test_application.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/test_application.py b/tests/test_application.py index 075acc80c..babf95497 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -83,9 +83,20 @@ def test_domain_override(app, status, warning): @pytest.mark.sphinx(testroot='add_source_parser') def test_add_source_parser(app, status, warning): assert set(app.config.source_suffix) == set(['.rst', '.md', '.test']) - assert set(app.registry.get_source_parsers().keys()) == set(['*', '.md', '.test']) + + # .rst; only in :confval:`source_suffix` + assert '.rst' not in app.registry.get_source_parsers() + assert app.registry.source_suffix['.rst'] is None + + # .md; configured by :confval:`source_suffix` and :confval:`source_parsers` + assert '.md' in app.registry.get_source_parsers() + assert app.registry.source_suffix['.md'] == '.md' assert app.registry.get_source_parsers()['.md'].__name__ == 'DummyMarkdownParser' - assert app.registry.get_source_parsers()['.test'].__name__ == 'TestSourceParser' + + # .test; configured by API + assert app.registry.source_suffix['.test'] == 'test' + assert 'test' in app.registry.get_source_parsers() + assert app.registry.get_source_parsers()['test'].__name__ == 'TestSourceParser' @pytest.mark.sphinx(testroot='extensions') |