diff options
Diffstat (limited to 'tests/test_ext_viewcode.py')
-rw-r--r-- | tests/test_ext_viewcode.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_ext_viewcode.py b/tests/test_ext_viewcode.py index 2540d09ea..3d9ea27d7 100644 --- a/tests/test_ext_viewcode.py +++ b/tests/test_ext_viewcode.py @@ -24,7 +24,7 @@ def test_viewcode(app, status, warning): warnings ) - result = (app.outdir / 'index.html').text() + result = (app.outdir / 'index.html').read_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() + result = (app.outdir / '_modules/spam/mod1.html').read_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() + stuff = (app.outdir / 'objects.html').read_text() assert 'http://foobar/source/foolib.py' in stuff assert 'http://foobar/js/' in stuff @@ -65,7 +65,7 @@ def test_linkcode(app, status, warning): def test_local_source_files(app, status, warning): def find_source(app, modname): if modname == 'not_a_package': - source = (app.srcdir / 'not_a_package/__init__.py').text() + source = (app.srcdir / 'not_a_package/__init__.py').read_text() tags = { 'func1': ('def', 1, 1), 'Class1': ('class', 1, 1), @@ -73,7 +73,7 @@ def test_local_source_files(app, status, warning): 'not_a_package.submodule.Class1': ('class', 1, 1), } else: - source = (app.srcdir / 'not_a_package/submodule.py').text() + source = (app.srcdir / 'not_a_package/submodule.py').read_text() tags = { 'not_a_package.submodule.func1': ('def', 11, 15), 'Class1': ('class', 19, 22), @@ -93,7 +93,7 @@ def test_local_source_files(app, status, warning): warnings ) - result = (app.outdir / 'index.html').text() + result = (app.outdir / 'index.html').read_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 |