summaryrefslogtreecommitdiffstats
path: root/tests/test_renderers/test_error_reporting.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:23:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:23:02 +0000
commit943e3dc057eca53e68ddec51529bd6a1279ebd8e (patch)
tree61fb7bac619a56dfbcdcbdb7b0d4d6535fc36fe9 /tests/test_renderers/test_error_reporting.py
parentInitial commit. (diff)
downloadmyst-parser-upstream.tar.xz
myst-parser-upstream.zip
Adding upstream version 0.18.1.upstream/0.18.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_renderers/test_error_reporting.py')
-rw-r--r--tests/test_renderers/test_error_reporting.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_renderers/test_error_reporting.py b/tests/test_renderers/test_error_reporting.py
new file mode 100644
index 0000000..2547e85
--- /dev/null
+++ b/tests/test_renderers/test_error_reporting.py
@@ -0,0 +1,22 @@
+"""Tests of the warning reporting for different MyST Markdown inputs."""
+from io import StringIO
+from pathlib import Path
+
+import pytest
+from docutils.core import publish_doctree
+
+from myst_parser.parsers.docutils_ import Parser
+
+FIXTURE_PATH = Path(__file__).parent.joinpath("fixtures")
+
+
+@pytest.mark.param_file(FIXTURE_PATH / "reporter_warnings.md")
+def test_basic(file_params):
+ """Test basic functionality."""
+ report_stream = StringIO()
+ publish_doctree(
+ file_params.content,
+ parser=Parser(),
+ settings_overrides={"warning_stream": report_stream},
+ )
+ file_params.assert_expected(report_stream.getvalue(), rstrip=True)