mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
encoding keyword for path.text() and path.write_text() is no longer needed
This commit is contained in:
@@ -24,7 +24,7 @@ def test_viewcode(app, status, warning):
|
||||
warnings
|
||||
)
|
||||
|
||||
result = (app.outdir / 'index.html').text(encoding='utf-8')
|
||||
result = (app.outdir / 'index.html').text()
|
||||
assert result.count('href="_modules/spam/mod1.html#func1"') == 2
|
||||
assert result.count('href="_modules/spam/mod2.html#func2"') == 2
|
||||
assert result.count('href="_modules/spam/mod1.html#Class1"') == 2
|
||||
@@ -37,7 +37,7 @@ def test_viewcode(app, status, warning):
|
||||
# the next assert fails, until the autodoc bug gets fixed
|
||||
assert result.count('this is the class attribute class_attr') == 2
|
||||
|
||||
result = (app.outdir / '_modules/spam/mod1.html').text(encoding='utf-8')
|
||||
result = (app.outdir / '_modules/spam/mod1.html').text()
|
||||
result = re.sub('<span class=".*?">', '<span>', result) # filter pygments classes
|
||||
assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
|
||||
'href="../../index.html#spam.Class1">[docs]</a>'
|
||||
@@ -53,7 +53,7 @@ def test_viewcode(app, status, warning):
|
||||
def test_linkcode(app, status, warning):
|
||||
app.builder.build(['objects'])
|
||||
|
||||
stuff = (app.outdir / 'objects.html').text(encoding='utf-8')
|
||||
stuff = (app.outdir / 'objects.html').text()
|
||||
|
||||
assert 'http://foobar/source/foolib.py' in stuff
|
||||
assert 'http://foobar/js/' in stuff
|
||||
@@ -93,7 +93,7 @@ def test_local_source_files(app, status, warning):
|
||||
warnings
|
||||
)
|
||||
|
||||
result = (app.outdir / 'index.html').text(encoding='utf-8')
|
||||
result = (app.outdir / 'index.html').text()
|
||||
assert result.count('href="_modules/not_a_package.html#func1"') == 1
|
||||
assert result.count('href="_modules/not_a_package.html#not_a_package.submodule.func1"') == 1
|
||||
assert result.count('href="_modules/not_a_package/submodule.html#Class1"') == 1
|
||||
|
||||
Reference in New Issue
Block a user