summaryrefslogtreecommitdiff
path: root/tests/test_setup_command.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-04-27 03:11:08 +0100
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-04-27 03:11:08 +0100
commit4674cc11c83c302102c167123de00a68b3d5dd88 (patch)
tree38c7a19f3621b4566de8a7eeefe64d4d72112d2a /tests/test_setup_command.py
parent24e3b7c8c8c0a2d01ec2d2d4d04105bcb565e440 (diff)
downloadsphinx-git-4674cc11c83c302102c167123de00a68b3d5dd88.tar.gz
`.write_text(...)` -> `.write_text(..., encoding='utf8')`
Diffstat (limited to 'tests/test_setup_command.py')
-rw-r--r--tests/test_setup_command.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py
index bfb2f2d96..a56f9d4a3 100644
--- a/tests/test_setup_command.py
+++ b/tests/test_setup_command.py
@@ -83,7 +83,7 @@ def nonascii_srcdir(request, setup_command):
(srcdir / mb_name / (mb_name + '.txt')).write_text(dedent("""
multi byte file name page
==========================
- """))
+ """), encoding='utf8')
root_doc = srcdir / 'index.txt'
root_doc.write_bytes((root_doc.read_text(encoding='utf8') + dedent("""
@@ -106,7 +106,8 @@ def test_build_sphinx_with_nonascii_path(setup_command):
def test_build_sphinx_return_nonzero_status(setup_command):
srcdir = (setup_command.pkgroot / 'doc')
(srcdir / 'contents.txt').write_text(
- 'http://localhost.unexistentdomain/index.html')
+ 'http://localhost.unexistentdomain/index.html',
+ encoding='utf8')
proc = setup_command.proc
out, err = proc.communicate()
print(out.decode())
@@ -117,7 +118,8 @@ def test_build_sphinx_return_nonzero_status(setup_command):
def test_build_sphinx_warning_return_zero_status(setup_command):
srcdir = (setup_command.pkgroot / 'doc')
(srcdir / 'contents.txt').write_text(
- 'See :ref:`unexisting-reference-label`')
+ 'See :ref:`unexisting-reference-label`',
+ encoding='utf8')
proc = setup_command.proc
out, err = proc.communicate()
print(out.decode())
@@ -129,7 +131,8 @@ def test_build_sphinx_warning_return_zero_status(setup_command):
def test_build_sphinx_warning_is_error_return_nonzero_status(setup_command):
srcdir = (setup_command.pkgroot / 'doc')
(srcdir / 'contents.txt').write_text(
- 'See :ref:`unexisting-reference-label`')
+ 'See :ref:`unexisting-reference-label`',
+ encoding='utf8')
proc = setup_command.proc
out, err = proc.communicate()
print(out.decode())