mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 09:00:00 -06:00
pytest: remove deprecated with_app decorator functions
This commit is contained in:
1 parent
b3c207dd49
commit
baaef9146d
38 files changed
+264
-246
No files matched your search
@@ -11,14 +11,15 @@
|
||||
|
||||
import re
|
||||
|
||||
from util import with_app, path, SkipTest
|
||||
import pytest
|
||||
from util import path, SkipTest
|
||||
|
||||
|
||||
def regex_count(expr, result):
|
||||
return len(re.findall(expr, result))
|
||||
|
||||
|
||||
@with_app('html', testroot='docutilsconf', freshenv=True, docutilsconf='')
|
||||
@pytest.mark.sphinx('html', testroot='docutilsconf', freshenv=True, docutilsconf='')
|
||||
def test_html_with_default_docutilsconf(app, status, warning):
|
||||
app.builder.build(['contents'])
|
||||
result = (app.outdir / 'contents.html').text(encoding='utf-8')
|
||||
@@ -29,7 +30,7 @@ def test_html_with_default_docutilsconf(app, status, warning):
|
||||
assert regex_count(r'<td class="option-group" colspan="2">', result) == 1
|
||||
|
||||
|
||||
@with_app('html', testroot='docutilsconf', freshenv=True, docutilsconf=(
|
||||
@pytest.mark.sphinx('html', testroot='docutilsconf', freshenv=True, docutilsconf=(
|
||||
'\n[html4css1 writer]'
|
||||
'\noption-limit:1'
|
||||
'\nfield-name-limit:1'
|
||||
@@ -45,31 +46,31 @@ def test_html_with_docutilsconf(app, status, warning):
|
||||
assert regex_count(r'<td class="option-group" colspan="2">', result) == 2
|
||||
|
||||
|
||||
@with_app('html', testroot='docutilsconf')
|
||||
@pytest.mark.sphinx('html', testroot='docutilsconf')
|
||||
def test_html(app, status, warning):
|
||||
app.builder.build(['contents'])
|
||||
assert warning.getvalue() == ''
|
||||
|
||||
|
||||
@with_app('latex', testroot='docutilsconf')
|
||||
@pytest.mark.sphinx('latex', testroot='docutilsconf')
|
||||
def test_latex(app, status, warning):
|
||||
app.builder.build(['contents'])
|
||||
assert warning.getvalue() == ''
|
||||
|
||||
|
||||
@with_app('man', testroot='docutilsconf')
|
||||
@pytest.mark.sphinx('man', testroot='docutilsconf')
|
||||
def test_man(app, status, warning):
|
||||
app.builder.build(['contents'])
|
||||
assert warning.getvalue() == ''
|
||||
|
||||
|
||||
@with_app('texinfo', testroot='docutilsconf')
|
||||
@pytest.mark.sphinx('texinfo', testroot='docutilsconf')
|
||||
def test_texinfo(app, status, warning):
|
||||
app.builder.build(['contents'])
|
||||
|
||||
|
||||
@with_app('html', testroot='docutilsconf',
|
||||
docutilsconf='[general]\nsource_link=true\n')
|
||||
@pytest.mark.sphinx('html', testroot='docutilsconf',
|
||||
docutilsconf='[general]\nsource_link=true\n')
|
||||
def test_docutils_source_link_with_nonascii_file(app, status, warning):
|
||||
srcdir = path(app.srcdir)
|
||||
mb_name = u'\u65e5\u672c\u8a9e'
|
||||
|
||||
Reference in new issue
Block a user