diff options
Diffstat (limited to 'tests/test_ext_apidoc.py')
-rw-r--r-- | tests/test_ext_apidoc.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py index 7500f1970..5e8789a8f 100644 --- a/tests/test_ext_apidoc.py +++ b/tests/test_ext_apidoc.py @@ -275,7 +275,7 @@ def test_multibyte_parameters(make_app, apidoc): assert (outdir / 'conf.py').isfile() assert (outdir / 'index.rst').isfile() - conf_py = (outdir / 'conf.py').read_text() + conf_py = (outdir / 'conf.py').read_text(encoding='utf8') assert "project = 'プロジェクト名'" in conf_py assert "author = '著者名'" in conf_py assert "version = 'バージョン'" in conf_py @@ -408,13 +408,13 @@ def test_private(tempdir): # without --private option apidoc_main(['-o', tempdir, tempdir]) assert (tempdir / 'hello.rst').exists() - assert ':private-members:' not in (tempdir / 'hello.rst').read_text() + assert ':private-members:' not in (tempdir / 'hello.rst').read_text(encoding='utf8') assert not (tempdir / '_world.rst').exists() # with --private option apidoc_main(['--private', '-f', '-o', tempdir, tempdir]) assert (tempdir / 'hello.rst').exists() - assert ':private-members:' in (tempdir / 'hello.rst').read_text() + assert ':private-members:' in (tempdir / 'hello.rst').read_text(encoding='utf8') assert (tempdir / '_world.rst').exists() @@ -426,7 +426,7 @@ def test_toc_file(tempdir): apidoc_main(['-o', tempdir, tempdir]) assert (outdir / 'modules.rst').exists() - content = (outdir / 'modules.rst').read_text() + content = (outdir / 'modules.rst').read_text(encoding='utf8') assert content == ("test_toc_file0\n" "==============\n" "\n" @@ -442,7 +442,7 @@ def test_module_file(tempdir): apidoc_main(['-o', tempdir, tempdir]) assert (outdir / 'example.rst').exists() - content = (outdir / 'example.rst').read_text() + content = (outdir / 'example.rst').read_text(encoding='utf8') assert content == ("example module\n" "==============\n" "\n" @@ -458,7 +458,7 @@ def test_module_file_noheadings(tempdir): apidoc_main(['--no-headings', '-o', tempdir, tempdir]) assert (outdir / 'example.rst').exists() - content = (outdir / 'example.rst').read_text() + content = (outdir / 'example.rst').read_text(encoding='utf8') assert content == (".. automodule:: example\n" " :members:\n" " :undoc-members:\n" @@ -477,7 +477,7 @@ def test_package_file(tempdir): assert (outdir / 'testpkg.rst').exists() assert (outdir / 'testpkg.subpkg.rst').exists() - content = (outdir / 'testpkg.rst').read_text() + content = (outdir / 'testpkg.rst').read_text(encoding='utf8') assert content == ("testpkg package\n" "===============\n" "\n" @@ -516,7 +516,7 @@ def test_package_file(tempdir): " :undoc-members:\n" " :show-inheritance:\n") - content = (outdir / 'testpkg.subpkg.rst').read_text() + content = (outdir / 'testpkg.subpkg.rst').read_text(encoding='utf8') assert content == ("testpkg.subpkg package\n" "======================\n" "\n" @@ -538,7 +538,7 @@ def test_package_file_separate(tempdir): assert (outdir / 'testpkg.rst').exists() assert (outdir / 'testpkg.example.rst').exists() - content = (outdir / 'testpkg.rst').read_text() + content = (outdir / 'testpkg.rst').read_text(encoding='utf8') assert content == ("testpkg package\n" "===============\n" "\n" @@ -558,7 +558,7 @@ def test_package_file_separate(tempdir): " :undoc-members:\n" " :show-inheritance:\n") - content = (outdir / 'testpkg.example.rst').read_text() + content = (outdir / 'testpkg.example.rst').read_text(encoding='utf8') assert content == ("testpkg.example module\n" "======================\n" "\n" @@ -575,7 +575,7 @@ def test_package_file_module_first(tempdir): (outdir / 'testpkg' / 'example.py').write_text('') apidoc_main(['--module-first', '-o', tempdir, tempdir]) - content = (outdir / 'testpkg.rst').read_text() + content = (outdir / 'testpkg.rst').read_text(encoding='utf8') assert content == ("testpkg package\n" "===============\n" "\n" @@ -603,7 +603,7 @@ def test_package_file_without_submodules(tempdir): apidoc_main(['-o', tempdir, tempdir / 'testpkg']) assert (outdir / 'testpkg.rst').exists() - content = (outdir / 'testpkg.rst').read_text() + content = (outdir / 'testpkg.rst').read_text(encoding='utf8') assert content == ("testpkg package\n" "===============\n" "\n" @@ -623,7 +623,7 @@ def test_namespace_package_file(tempdir): apidoc_main(['--implicit-namespace', '-o', tempdir, tempdir / 'testpkg']) assert (outdir / 'testpkg.rst').exists() - content = (outdir / 'testpkg.rst').read_text() + content = (outdir / 'testpkg.rst').read_text(encoding='utf8') assert content == ("testpkg namespace\n" "=================\n" "\n" |