mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
test: Merge testcases having the same name
This commit is contained in:
parent
ba496f4d92
commit
f86366a2df
@ -89,15 +89,6 @@ def assert_count(expected_expr, result, count):
|
|||||||
assert len(re.findall(*find_pair)) == count, find_pair
|
assert len(re.findall(*find_pair)) == count, find_pair
|
||||||
|
|
||||||
|
|
||||||
@sphinx_intl
|
|
||||||
@pytest.mark.sphinx('text')
|
|
||||||
@pytest.mark.test_params(shared_result='test_intl_basic')
|
|
||||||
def test_text_toctree(app):
|
|
||||||
app.build()
|
|
||||||
result = (app.outdir / 'index.txt').read_text()
|
|
||||||
assert_startswith(result, "CONTENTS\n********\n\nTABLE OF CONTENTS\n")
|
|
||||||
|
|
||||||
|
|
||||||
@sphinx_intl
|
@sphinx_intl
|
||||||
@pytest.mark.sphinx('text')
|
@pytest.mark.sphinx('text')
|
||||||
@pytest.mark.test_params(shared_result='test_intl_basic')
|
@pytest.mark.test_params(shared_result='test_intl_basic')
|
||||||
@ -436,11 +427,16 @@ def test_text_admonitions(app):
|
|||||||
@pytest.mark.test_params(shared_result='test_intl_gettext')
|
@pytest.mark.test_params(shared_result='test_intl_gettext')
|
||||||
def test_gettext_toctree(app):
|
def test_gettext_toctree(app):
|
||||||
app.build()
|
app.build()
|
||||||
# --- toctree
|
# --- toctree (index.rst)
|
||||||
expect = read_po(app.srcdir / 'xx' / 'LC_MESSAGES' / 'index.po')
|
expect = read_po(app.srcdir / 'xx' / 'LC_MESSAGES' / 'index.po')
|
||||||
actual = read_po(app.outdir / 'index.pot')
|
actual = read_po(app.outdir / 'index.pot')
|
||||||
for expect_msg in [m for m in expect if m.id]:
|
for expect_msg in [m for m in expect if m.id]:
|
||||||
assert expect_msg.id in [m.id for m in actual if m.id]
|
assert expect_msg.id in [m.id for m in actual if m.id]
|
||||||
|
# --- toctree (toctree.rst)
|
||||||
|
expect = read_po(app.srcdir / 'xx' / 'LC_MESSAGES' / 'toctree.po')
|
||||||
|
actual = read_po(app.outdir / 'toctree.pot')
|
||||||
|
for expect_msg in [m for m in expect if m.id]:
|
||||||
|
assert expect_msg.id in [m.id for m in actual if m.id]
|
||||||
|
|
||||||
|
|
||||||
@sphinx_intl
|
@sphinx_intl
|
||||||
@ -467,24 +463,17 @@ def test_text_table(app):
|
|||||||
assert expect_msg.string in result
|
assert expect_msg.string in result
|
||||||
|
|
||||||
|
|
||||||
@sphinx_intl
|
|
||||||
@pytest.mark.sphinx('gettext')
|
|
||||||
@pytest.mark.test_params(shared_result='test_intl_gettext')
|
|
||||||
def test_gettext_toctree(app):
|
|
||||||
app.build()
|
|
||||||
# --- toctree
|
|
||||||
expect = read_po(app.srcdir / 'xx' / 'LC_MESSAGES' / 'toctree.po')
|
|
||||||
actual = read_po(app.outdir / 'toctree.pot')
|
|
||||||
for expect_msg in [m for m in expect if m.id]:
|
|
||||||
assert expect_msg.id in [m.id for m in actual if m.id]
|
|
||||||
|
|
||||||
|
|
||||||
@sphinx_intl
|
@sphinx_intl
|
||||||
@pytest.mark.sphinx('text')
|
@pytest.mark.sphinx('text')
|
||||||
@pytest.mark.test_params(shared_result='test_intl_basic')
|
@pytest.mark.test_params(shared_result='test_intl_basic')
|
||||||
def test_text_toctree(app):
|
def test_text_toctree(app):
|
||||||
app.build()
|
app.build()
|
||||||
# --- toctree
|
# --- toctree (index.rst)
|
||||||
|
# Note: index.rst contains contents that is not shown in text.
|
||||||
|
result = (app.outdir / 'index.txt').read_text()
|
||||||
|
assert 'CONTENTS' in result
|
||||||
|
assert 'TABLE OF CONTENTS' in result
|
||||||
|
# --- toctree (toctree.rst)
|
||||||
result = (app.outdir / 'toctree.txt').read_text()
|
result = (app.outdir / 'toctree.txt').read_text()
|
||||||
expect = read_po(app.srcdir / 'xx' / 'LC_MESSAGES' / 'toctree.po')
|
expect = read_po(app.srcdir / 'xx' / 'LC_MESSAGES' / 'toctree.po')
|
||||||
for expect_msg in [m for m in expect if m.id]:
|
for expect_msg in [m for m in expect if m.id]:
|
||||||
|
Loading…
Reference in New Issue
Block a user