summaryrefslogtreecommitdiff
path: root/tests/test_setup_command.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-11-12 11:21:22 -0800
committerJon Dufresne <jon.dufresne@gmail.com>2018-11-13 18:08:49 -0800
commit41ad0d5347b37dc79202dee3e551d59477d73ad6 (patch)
tree2f75c98b096401a858dd8e7909fee96793e2de75 /tests/test_setup_command.py
parent45ad2e41a56a7fad0d9c3e8c32c54949c96bfa25 (diff)
downloadsphinx-git-41ad0d5347b37dc79202dee3e551d59477d73ad6.tar.gz
Fix all BytesWarning identified through tests
Code should not arbitrarily mix bytes & str values. The values should be understood and deliberate. When Python is run with the -b option, this change fixes warnings of the form: BytesWarning: str() on a bytes instance
Diffstat (limited to 'tests/test_setup_command.py')
-rw-r--r--tests/test_setup_command.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py
index 51cfca205..1e4111be9 100644
--- a/tests/test_setup_command.py
+++ b/tests/test_setup_command.py
@@ -54,8 +54,8 @@ def setup_command(request, tempdir, rootdir):
def test_build_sphinx(setup_command):
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode == 0
@@ -63,8 +63,8 @@ def test_build_sphinx(setup_command):
def test_build_sphinx_multiple_builders(setup_command):
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode == 0
@@ -72,8 +72,8 @@ def test_build_sphinx_multiple_builders(setup_command):
def test_build_sphinx_multiple_invalid_builders(setup_command):
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode == 1
@@ -106,8 +106,8 @@ def nonascii_srcdir(request, setup_command):
def test_build_sphinx_with_nonascii_path(setup_command):
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode == 0
@@ -118,8 +118,8 @@ def test_build_sphinx_return_nonzero_status(setup_command):
'http://localhost.unexistentdomain/index.html')
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode != 0, 'expect non-zero status for setup.py'
@@ -129,8 +129,8 @@ def test_build_sphinx_warning_return_zero_status(setup_command):
'See :ref:`unexisting-reference-label`')
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode == 0
@@ -141,6 +141,6 @@ def test_build_sphinx_warning_is_error_return_nonzero_status(setup_command):
'See :ref:`unexisting-reference-label`')
proc = setup_command.proc
out, err = proc.communicate()
- print(out)
- print(err)
+ print(out.decode())
+ print(err.decode())
assert proc.returncode != 0, 'expect non-zero status for setup.py'