Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_intl.py')
-rw-r--r--tests/test_intl.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_intl.py b/tests/test_intl.py
index 44740f67d..cf7180282 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -189,6 +189,32 @@ def test_text_inconsistency_warnings(app, warning):
@sphinx_intl
@pytest.mark.sphinx('text')
@pytest.mark.test_params(shared_result='test_intl_basic')
+def test_noqa(app, warning):
+ app.build()
+ result = (app.outdir / 'noqa.txt').read_text()
+ expect = r"""FIRST SECTION
+*************
+
+TRANSLATED TEXT WITHOUT REFERENCE.
+
+TEST noqa WHITESPACE INSENSITIVITY.
+
+"#noqa" IS ESCAPED AT THE END OF THIS STRING. #noqa
+
+
+NEXT SECTION WITH PARAGRAPH TO TEST BARE noqa
+*********************************************
+
+Some text, again referring to the section: NEXT SECTION WITH PARAGRAPH
+TO TEST BARE noqa.
+"""
+ assert result == expect
+ assert "next-section" not in getwarning(warning)
+
+
+@sphinx_intl
+@pytest.mark.sphinx('text')
+@pytest.mark.test_params(shared_result='test_intl_basic')
def test_text_literalblock_warnings(app, warning):
app.build()
# --- check warning for literal block
@@ -1180,6 +1206,9 @@ def test_additional_targets_should_be_translated(app):
"""<span class="c1"># SYS IMPORTING</span>""")
assert_count(expected_expr, result, 1)
+ # '#noqa' should remain in literal blocks.
+ assert_count("#noqa", result, 1)
+
# [raw.txt]
result = (app.outdir / 'raw.html').read_text()