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_search.py | |
parent | 7d6374d983cc757e8bb7911da13f2dce7d69ec36 (diff) | |
download | sphinx-git-4dd8b1022f581e8e42db520eb1061f064cbdf63f.tar.gz |
test: Use read_text() and read_bytes()
Diffstat (limited to 'tests/test_search.py')
-rw-r--r-- | tests/test_search.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_search.py b/tests/test_search.py index 802602d5f..60631f7a4 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -41,7 +41,7 @@ def setup_module(): def jsload(path): - searchindex = path.text() + searchindex = path.read_text() assert searchindex.startswith('Search.setIndex(') assert searchindex.endswith(')') @@ -98,7 +98,7 @@ def test_meta_keys_are_handled_for_language_de(app, status, warning): @pytest.mark.sphinx(testroot='search') def test_stemmer_does_not_remove_short_words(app, status, warning): app.builder.build_all() - searchindex = (app.outdir / 'searchindex.js').text() + searchindex = (app.outdir / 'searchindex.js').read_text() assert 'zfs' in searchindex @@ -112,7 +112,7 @@ def test_stemmer(app, status, warning): @pytest.mark.sphinx(testroot='search') def test_term_in_heading_and_section(app, status, warning): - searchindex = (app.outdir / 'searchindex.js').text() + searchindex = (app.outdir / 'searchindex.js').read_text() # if search term is in the title of one doc and in the text of another # both documents should be a hit in the search index as a title, # respectively text hit @@ -247,7 +247,7 @@ def test_IndexBuilder_lookup(): def test_search_index_gen_zh(app, status, warning): app.builder.build_all() # jsdump fails if search language is 'zh'; hence we just get the text: - searchindex = (app.outdir / 'searchindex.js').text() + searchindex = (app.outdir / 'searchindex.js').read_text() assert 'chinesetest ' not in searchindex assert 'chinesetest' in searchindex assert 'chinesetesttwo' in searchindex |