encoding keyword for path.text() and path.write_text() is no longer needed

This commit is contained in:
Takeshi KOMIYA
2019-01-03 10:58:07 +09:00
parent 657fa843c8
commit c4c878303f
10 changed files with 68 additions and 71 deletions
+4 -4
View File
@@ -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