diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-01 11:58:51 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-01 11:58:51 +0900 |
commit | 4dd8b1022f581e8e42db520eb1061f064cbdf63f (patch) | |
tree | df4d2f69233f91aff7b9d3e3dee58c50d0991c2e /tests/test_ext_coverage.py | |
parent | 7d6374d983cc757e8bb7911da13f2dce7d69ec36 (diff) | |
download | sphinx-git-4dd8b1022f581e8e42db520eb1061f064cbdf63f.tar.gz |
test: Use read_text() and read_bytes()
Diffstat (limited to 'tests/test_ext_coverage.py')
-rw-r--r-- | tests/test_ext_coverage.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_ext_coverage.py b/tests/test_ext_coverage.py index 87e5e4931..16f53112b 100644 --- a/tests/test_ext_coverage.py +++ b/tests/test_ext_coverage.py @@ -17,7 +17,7 @@ import pytest def test_build(app, status, warning): app.builder.build_all() - py_undoc = (app.outdir / 'python.txt').text() + py_undoc = (app.outdir / 'python.txt').read_text() assert py_undoc.startswith('Undocumented Python objects\n' '===========================\n') assert 'autodoc_target\n--------------\n' in py_undoc @@ -28,13 +28,13 @@ def test_build(app, status, warning): assert ' * mod -- No module named mod' # in the "failed import" section - c_undoc = (app.outdir / 'c.txt').text() + c_undoc = (app.outdir / 'c.txt').read_text() assert c_undoc.startswith('Undocumented C API elements\n' '===========================\n') assert 'api.h' in c_undoc assert ' * Py_SphinxTest' in c_undoc - undoc_py, undoc_c = pickle.loads((app.outdir / 'undoc.pickle').bytes()) + undoc_py, undoc_c = pickle.loads((app.outdir / 'undoc.pickle').read_bytes()) assert len(undoc_c) == 1 # the key is the full path to the header file, which isn't testable assert list(undoc_c.values())[0] == {('function', 'Py_SphinxTest')} @@ -50,7 +50,7 @@ def test_build(app, status, warning): @pytest.mark.sphinx('coverage', testroot='ext-coverage') def test_coverage_ignore_pyobjects(app, status, warning): app.builder.build_all() - actual = (app.outdir / 'python.txt').text() + actual = (app.outdir / 'python.txt').read_text() expected = '''Undocumented Python objects =========================== coverage_not_ignored |