test: Use Path.read_text() instead

This commit is contained in:
Takeshi KOMIYA 2020-02-16 20:43:51 +09:00
parent 57d63ab50b
commit ccd7381d38
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ def test_dirhtml(app, status, warning):
assert (app.outdir / 'foo/foo_2/index.html').exists()
assert (app.outdir / 'bar/index.html').exists()
content = (app.outdir / 'index.html').text()
content = (app.outdir / 'index.html').read_text()
assert 'href="foo/"' in content
assert 'href="foo/foo_1/"' in content
assert 'href="foo/foo_2/"' in content

View File

@ -168,7 +168,7 @@ def test_domain_py_objects(app, status, warning):
def test_resolve_xref_for_properties(app, status, warning):
app.builder.build_all()
content = (app.outdir / 'module.html').text()
content = (app.outdir / 'module.html').read_text()
assert ('Link to <a class="reference internal" href="#module_a.submodule.ModTopLevel.prop"'
' title="module_a.submodule.ModTopLevel.prop">'
'<code class="xref py py-attr docutils literal notranslate"><span class="pre">'